Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: can i style br?

  1. #1
    New Coder
    Join Date
    Oct 2007
    Posts
    20
    Thanks
    2
    Thanked 0 Times in 0 Posts

    can i style br?

    hello

    can i style br? it being a selfcontained selector?

    it isnt included in http://www.w3.org/TR/2007/CR-CSS21-2...9/propidx.html

    i was thinking

    br {
    margin-bottom: 15px;
    }

    instead of doing double brs inside ps

    any problems?

    thanks
    rasmus
    Last edited by samtaleterapi; 10-29-2007 at 11:38 AM.

  • #2
    Regular Coder Actinia's Avatar
    Join Date
    Feb 2007
    Location
    Essex, UK
    Posts
    250
    Thanks
    1
    Thanked 23 Times in 22 Posts
    Why don't you just try it and see?

    From my experimentation, the answer is no. You cannot style the <br /> either by styling the tag or setting a class.

    This is true for FF2 and IE7.

    John Rostron

  • #3
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,918
    Thanks
    6
    Thanked 1,040 Times in 1,013 Posts
    Why don’t you just try it if you already know what you want?
    Line breaks can be styled, although possibilities are limited. Best would be to try it, then you see what’s possible in which browser.

  • #4
    Regular Coder
    Join Date
    Jun 2004
    Posts
    495
    Thanks
    0
    Thanked 82 Times in 80 Posts
    Doesn't work x-browser.
    The present trend is not/never to use <br>, but apply a margin to another element.

  • #5
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    The best way to style a <br> is to apply a line-height to the element it is contained within.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • Users who have thanked felgall for this post:

    timgolding (10-30-2007)

  • #6
    Regular Coder
    Join Date
    Jul 2007
    Posts
    571
    Thanks
    25
    Thanked 28 Times in 28 Posts
    why are you styling a <br> in the first place? Why dont u just add the margin to wtv u need the space under?

  • Users who have thanked srule_ for this post:

    timgolding (10-30-2007)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •