Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS What's Wrong With My CSS?

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #156348
    say
    Participant

    Hi, I face some problem. Here is the HTML:

    <div>
      <ul>
        <li>
          <a href="">HOME</a>
        </li>
        <li>
          <a href="">ABOUT</a>
        </li>
        <li>
          <a href="">SERVICES</a>
        </li>
        <li>
          <a href="">PORTFOLIO</a>
        </li>
        <li>
          <a href="">BLOG</a>
        </li>
        <li>
          <a href="">CONTACT</a>
        </li>
      </ul>
    </div>
    

    And here is the CSS:

    body {
      padding:0;
      margin:0;
    }
    .header {
      width:auto;
      max-width:900px;
      margin:0 auto;
    }
    .header h2 {
      margin:35px 0 35px 0;
      position:relative;
    }
    .nav {
      background:green;
    }
    .nav .menu {
      list-style:none;
    }
     .nav .menu li {
      display:inline;
      float:left;
    }
    .nav .menu li a {
      display: inline-block;
      width: 140px;
      height: 45px;
      font: bold 13px 'Arial', sans-serif ;
      color: #fff;
      text-decoration: none;
      text-align: center;
      line-height: 48px;
      border-right: 1px solid #111;
    }
    

    But my nav bar doesn’t visible. There are just some borders,no text or background-color. I can’t understand what’s wrong. Can anyone help me?

    #156383
    Steven Crader
    Participant

    We will be unable to help since the CSS references classes but none are in the HTML provided. Also, if you could make a CodePen that reproduces the issue it would help a lot.

    #156384
    __
    Participant

    Your question is unclear. There are no elements in the html markup you posted that match any of the css rules.

    The html + css you posted renders like this:

    screenshot from jsfiddle

    It displays as expected and does not match your description of the problem at all.

    Perhaps you could share a link to the page in question, or recreate the problem on codepen?

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.