WordPress.org

Ready to get started?Download WordPress

Forums

Using the <br> tag (12 posts)

  1. Fess
    Member
    Posted 7 years ago #

    Hello,

    I wanted to add some useful links to my sidebar.php ,but was wondering if using the <br> tag was correct when using php?
    /*

  2. <h2>Navigation</h2>
  3. */
    Thanks
    Fess

  • theiconoclast31
    Member
    Posted 7 years ago #

    <br> should be okay, but you may have to change it to <br /> if you want it to validate. If it's a navbar, most people would just adjust the margins using CSS.

  • vkaryl
    Member
    Posted 7 years ago #

    Well, with a couple of caveats: it's actually in the xhtml that you're using it, so you need to use <br /> (the self-closing xhtml version); and depending on where you put the breaks, they may not validate. Then you get to move them around if validation is important to you (it's not to many people....)

  • rossz
    Member
    Posted 7 years ago #

    Links in a sidebar should be listed in unordered lists using li tags.

  • vkaryl
    Member
    Posted 7 years ago #

    rossz: depends entirely on theme. I have various themes which don't need the extra <li> since the links are held outside the nested links area.

    You can't really make sweeping statements like that.

  • rossz
    Member
    Posted 7 years ago #

    I disagree. Lists of links are lists. Therefore they should be formatted with the li tag and proper css.

  • vkaryl
    Member
    Posted 7 years ago #

    Okay.... whatever. Depends on what you call proper I guess. To me proper is whatever validates, and displays appropriately in all major browsers.

  • rossz
    Member
    Posted 7 years ago #

    It's that kind of thinking that got us tables nested twenty levels deep on far too many websites. Yes, it works. Yes it validates. No, it is not a good practice. Have you ever tried to make changes to one of those websites? I have. It's a painful process.

    Take a look at http://css.maxdesign.com.au/listamatic/ for some reasons why using lists is the preferred way to go.

  • vkaryl
    Member
    Posted 7 years ago #

    Heh. Friend, I've been redesigning crap websites for 10 years.

    'nough said. (BTW, did I say anything about tables? No. And while listamatic is okay, there are FAR better sites for good CSS info out there.)

  • theiconoclast31
    Member
    Posted 7 years ago #

    You're both right. It's best-practice v. practical thinking, and if someone finds the golden answer to that debate, let me know.

  • vkaryl
    Member
    Posted 7 years ago #

    True in essence.... I tend to not want nested lists either, though.... lists are the web2.0 tables, ain't? *laughing*

  • Fess
    Member
    Posted 7 years ago #

    Thanks for the reply guys.

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags