Simple element div with text inside

It's really boring to have to use a

"p" or a "span" inside a div just for put text on screen. It's easy to make a component, but i think it could be cool to have this basic element with the possibility to give it a css class or an id:

  <div id="MyDiv" class="MyClass"> This is a very simple text </div>

Or more simple, have the possibility to write text where we want....

I agree

I won't speak for everyone else, but will say that the reason this post never got any love is because the idea is not practical.

When you do proper website coding and building, you don't put text in empty locations. I can't see a single reason why there is a problem with adding paragraphs, spans, Headings etc. What's the problem for you with adding those?

If it's because the styling isn't quite right for you, adjust it in the CSS. You have all the control and power at your fingertips to do so. Just add a class to the text element and to your custom CSS file for it and style it how you want it. Pretty simple and that's the proper way to handle it. Don't think anything like this is even close to a necessity or need. Just my opinion of course. :)

I agree with @Jo the paragraph makes the code semantic, thus using

<

p> for text and <Hn> for headings.

  • Michael

“When you do proper website coding and building, you don’t put text in empty locations” I disagree, according to who?

Also, it is not in an empty location… it is in a div.

If you look at this https://getbootstrap.com/docs/4.0/components/card/#header-and-footer they do it here… and in BSS when you create a custom code element, the sample is <div>Custom Code</div>

Adding a Custom Code to a Div just to add some text is probably okay for my needs (using BSS only as a platform to quickly create and preview simple partial html components). In my opinion, BSS should be able to allow you to add any text anywhere without having to add components.

EVERYTHING you add to the page in BSS is added via a Component. The Components simply represent HTML elements (<p> <div> <span> <img> etc…) How else would you add text to the page if not via a Component?

BSS only allow text in those components that can contain text in BSS. A <div> isn’t such kind of component. If you convert custom code <div>Custom Code</div> to a component then you will get

<div>
  <span>Custom Code</span>
</div>

If you need only text inside a <div> use a Custom Code Block.

But it is absolutely okay to have text in a <div> element in HTML. In fact, <div> is a commonly used container element for grouping and organizing content on a webpage. Search engines, including Google, can perfectly understand and index the text within <div> elements.