When should i use OR NOT use break tags?

i heard break tags aren't good but its so quick and easy, what should i use instead to get the extra spaces i need?
22 Replies
xel
xel10mo ago
would be easier to say if you showed an example of what you want, but space is generally added with things like margin and padding
TrickShottasUnited
i dont have a visual example right now, but you know when you have a long line of text and u want it to break and continue on the line below instead of it running all the way to the right?
xel
xel10mo ago
1 way would just be defining a width or max width of the element containing the text https://codepen.io/Xe11o/pen/poqomNK
TrickShottasUnited
oh like that ch unit keven talks about thank u the last thing i mean is if u have 2 paragraphs one below the enxt and u want more space between them that normal, use margin too?
snxxwyy
snxxwyy10mo ago
- if want it to look like the first section simply just set a max-width either using ch or em/rem. - if you want it to look like the second section have two p tags and reset their margins to get rid of the default margin values and at the top using, p { margin: 0; }. Then give the first tag a utility class such as space-underneath and style it as such, .space-underneath: margin-bottom: VALUE-HERErem;
No description
TrickShottasUnited
thx bro
snxxwyy
snxxwyy10mo ago
👍
vince
vince10mo ago
Hopping in here to say that I use <br /> sometimes if I want something to be very specific Here's my hero heading for my website. I wanted it to break after custom-coded so I added a <br />. You can also use css to break a line apart. Probably better if you use css as you can customize it depending on the viewport easily
No description
snxxwyy
snxxwyy10mo ago
@trickshottasunited here's a codepen of the examples https://codepen.io/deerCabin/pen/vYvYwxK. i've just updated it with some more info 👍
TrickShottasUnited
bet how do u get it to automatically word wrap?
snxxwyy
snxxwyy10mo ago
how the words wrap at smaller screen sizes?
TrickShottasUnited
i mean in the editor when u do some lorem text
snxxwyy
snxxwyy10mo ago
it's in settings if you're talking about codepen it's in settings, if you're talking about another editor you have to do it yourself or set up a boilerplate i believe.
TrickShottasUnited
okay ill figure it out
snxxwyy
snxxwyy10mo ago
@trickshottasunited and @vince (since you gave me the eyes 😂), if you're using vscode it's a setting called word-wrap
vince
vince10mo ago
There's also industry standard thing called Prettier
snxxwyy
snxxwyy10mo ago
i don't think that's industry standard is it? it's like an optional thing
vince
vince10mo ago
I've seen open source projects use it
snxxwyy
snxxwyy10mo ago
it must be a preference thing right?
vince
vince10mo ago
Maybe not sure. I was under the impression that it was pretty standard but I don't have much of any experience 😂 I really like it I can copy paste stuff or just write stuff and press save and it formats it Though the formatting at times can be really annoying
snxxwyy
snxxwyy10mo ago
that's why i don't use it tbh seems cool none the less though, might start using it
vince
vince10mo ago
Ye some people prefer it and others don't