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
xel16mo 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
TrickShottasUnitedOP16mo ago
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
xel16mo 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
TrickShottasUnitedOP16mo ago
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
snxxwyy16mo 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
TrickShottasUnitedOP16mo ago
thx bro
snxxwyy
snxxwyy16mo ago
👍
vince
vince16mo 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
snxxwyy16mo 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
TrickShottasUnitedOP16mo ago
bet how do u get it to automatically word wrap?
snxxwyy
snxxwyy16mo ago
how the words wrap at smaller screen sizes?
TrickShottasUnited
TrickShottasUnitedOP16mo ago
i mean in the editor when u do some lorem text
snxxwyy
snxxwyy16mo 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
TrickShottasUnitedOP16mo ago
okay ill figure it out
snxxwyy
snxxwyy16mo ago
@trickshottasunited and @vince (since you gave me the eyes 😂), if you're using vscode it's a setting called word-wrap
vince
vince16mo ago
There's also industry standard thing called Prettier
snxxwyy
snxxwyy16mo ago
i don't think that's industry standard is it? it's like an optional thing
vince
vince16mo ago
I've seen open source projects use it
snxxwyy
snxxwyy16mo ago
it must be a preference thing right?
vince
vince16mo 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
snxxwyy16mo ago
that's why i don't use it tbh seems cool none the less though, might start using it
vince
vince16mo ago
Ye some people prefer it and others don't
Want results from more Discord servers?
Add your server