Jump to content

What is the best way to insert blank lines in HTML?


helpneeded22

Recommended Posts

there are many ways. depends on your overall design, where and how u wish blank lines or spaces. the best way is to use css. using css you can do anything to anything (regarding design :P).. in css there are elements like padding and margin to make line spaces. line break <br /> can also be used. using empty paragraph or div is not recommended, so fas as I know...

Link to comment
Share on other sites

padding, margins are not elements they are properties, they are applied to elements, using line break as spacing is a bad idea as its height is dependant on current font-size, line-height used within the current element you use the line break in, therefore it would not be a constant set height. Also different browsers can give different results when line-break tag is used for spacing.

Link to comment
Share on other sites

thank u for clarifying about element and properties.

 

so far the idea of line break concerns, I've also suggested using css. using css we can set the margins or paddings or anything for any tag, right? and so can be done for line breaks also??

Link to comment
Share on other sites

Yes! but there is no need, you have margins, and padding available to use. You can pre-set styling for line-break, but you would then have make sure in future that any CSS styling used for example line-height, and font-size does not override the line break styling because it has a higher precedence.

Link to comment
Share on other sites

Up to now I have found only two legitimate uses for a <br> element:

  1. Line breaks in a mailing address.
  2. Line breaks in poetry.

If you use <br> to create vertical space you'll find yourself with a lot of work to do when you decide to change how large you want to space to be on 20 different pages on your site.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...