helpneeded22 Posted February 7, 2015 Share Posted February 7, 2015 I am trying to update my HTML knowledge as quite a lot I have learned in the past has been depreciated. In the past when I wanted to insert blank lines I would use: <p> </p> and </ br> Is there a better way to do this now? Link to comment Share on other sites More sharing options...
dsonesuk Posted February 8, 2015 Share Posted February 8, 2015 The idea is to use padding or margins on elements to acheive the same result as using empty paragraphs or line breaks. Link to comment Share on other sites More sharing options...
funbinod Posted February 8, 2015 Share Posted February 8, 2015 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 ).. 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 More sharing options...
dsonesuk Posted February 8, 2015 Share Posted February 8, 2015 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 More sharing options...
funbinod Posted February 8, 2015 Share Posted February 8, 2015 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 More sharing options...
dsonesuk Posted February 8, 2015 Share Posted February 8, 2015 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 More sharing options...
funbinod Posted February 9, 2015 Share Posted February 9, 2015 that's why I've mentioned ".......... depends on .... overall design, where and how u wish blank lines or spaces..........." Link to comment Share on other sites More sharing options...
dsonesuk Posted February 9, 2015 Share Posted February 9, 2015 Yes! but you mention using BR element for spacing, which should not be considered at all, for reasons already mentioned, if you want spacing, adjust margins or padding, don't use BR, use BR just for what was intended for, a line break without causing a space. Link to comment Share on other sites More sharing options...
Ingolme Posted February 9, 2015 Share Posted February 9, 2015 Up to now I have found only two legitimate uses for a <br> element: Line breaks in a mailing address. 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. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now