B

Struct B 

Source
pub struct B;
Expand description

The <b> element - bring attention to.

§Purpose

The <b> element draws attention to content without conveying extra importance, seriousness, or emphasis. Used for keywords, product names, or other spans of text whose typical presentation is bold. Not for emphasis—use <strong> for that.

§Content Categories

  • Flow Content
  • Phrasing Content
  • Palpable Content

§Permitted Content Model

  • Phrasing content

§Common Use Cases

  • Keywords in a document
  • Product names in reviews
  • Lead-in words or phrases
  • Drawing attention without semantic importance

§Key Attributes

  • Global attributes only

§Example

<p><b>Note:</b> This feature is experimental.</p>
<p>The <b>iPhone 15</b> was released in September 2023.</p>
<p><b>Ingredients:</b> flour, sugar, eggs, butter.</p>

§WHATWG Specification

Trait Implementations§

Source§

impl HtmlElement for B

Source§

const TAG: &'static str = "b"

The HTML tag name (e.g., “div”, “span”, “img”).
Source§

const VOID: bool = false

Whether this is a void element (self-closing, no children allowed).
Source§

impl<T: PhrasingContent> CanContain<T> for B

Source§

impl CanContain<Text> for B

Source§

impl FlowContent for B

Source§

impl PalpableContent for B

Source§

impl PhrasingContent for B

Auto Trait Implementations§

§

impl Freeze for B

§

impl RefUnwindSafe for B

§

impl Send for B

§

impl Sync for B

§

impl Unpin for B

§

impl UnwindSafe for B

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.