How to insert text inside a Div ?

Let's say I want to get this :

<div class="child-one">One</div>

I can't find a way to just enter the text : One in any window

Any help ? Thanks Fransua

1 Like

Please watch and read the tutorials as you are asking basic questions about this app that are mostly covered in them.

Add a Custom Component to your page, double click it, and write your HTML there. Although that's a rather absurd way to add text to a program that give you pre-made <p> components.

BSS uses/provides components so you don't have to write HTML. You need to do as @Jo said, and read the tutorials and watch the videos. You lack a fundamental understanding of how this program works. You're trying to reinvent the wheel, and sidestep the time-saving features BSS exists to provide.

this is not a basic question, when I select the div, there is no way to enter text on it, it is different behaviour as if I insert a paragraph

Both <div> and <p> are block-level elements in HTML, but they have different purposes and semantic meanings.

  1. <div> (Division):

    • Purpose: The <div> tag is a generic container used to group elements together for styling or scripting purposes. It doesn’t have any inherent meaning or semantic value in itself.
    • Use Case: Typically used when you want to apply CSS styles, JavaScript, or structure content without implying any specific meaning about the content.
    • Example:
      <div class="container">
        <h1>Title</h1>
        <p>This is a paragraph.</p>
      </div>
      
  2. <p> (Paragraph):

    • Purpose: The <p> tag is specifically for defining a paragraph of text. It has semantic meaning in HTML, indicating that the content inside it is a paragraph.
    • Use Case: Used for wrapping text content that forms a paragraph. It’s used when you want to structure content that is meant to be a block of text.
    • Example:
      <p>This is a paragraph of text.</p>
      
    • It is meant to be read as part of a narrative or explanation.

Key Differences:

  • Semantics: <div> is purely a structural element, while <p> has semantic meaning to indicate a paragraph of text.
  • Content: <p> should only contain text or inline elements (e.g., links, bold text), and it will automatically add spacing before and after the content. On the other hand, <div> can contain any type of content, including other block-level elements.
  • Default Styling: Browsers typically apply default styling to <p> (like margins), but <div> has no default styling applied.

In short: use <div> for grouping content when no semantic meaning is required, and use <p> when you want to mark up a block of text as a paragraph.

1 Like