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
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
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?
1 way would just be defining a width or max width of the element containing the text
https://codepen.io/Xe11o/pen/poqomNK
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?
- 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;
thx bro
👍
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
@trickshottasunited here's a codepen of the examples https://codepen.io/deerCabin/pen/vYvYwxK.
i've just updated it with some more info 👍
bet
how do u get it to automatically word wrap?
how the words wrap at smaller screen sizes?
i mean in the editor
when u do some lorem text
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.
okay ill figure it out
@trickshottasunited and @vince (since you gave me the eyes 😂), if you're using vscode it's a setting called
word-wrap
There's also industry standard thing called Prettier
i don't think that's industry standard is it?
it's like an optional thing
I've seen open source projects use it
it must be a preference thing right?
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
that's why i don't use it tbh
seems cool none the less though, might start using it
Ye some people prefer it and others don't