I need your help please

Discussion in 'HTML & Website Design' started by Carl29, Feb 10, 2011.

  1. #1
    Hi, please check image.jpg .
    I need that first link is clikable, but "Home" text not. Here's my code:
    
    <div id="vercontainer">
    	<ul id="verlist">
    		<li id="active"><a href="#" id="current">Link number 1</a></li>
    		<li><a href="#">Link number 2</a></li>
    		<li><a href="#">Link number 3</a></li>
    		<li><a href="#">Link number 4</a></li>
    	</ul>
    </div>
    
    Code (markup):
    and the css:
    
    #vercontainer
    {
    float: left;
    width: 120px;
    margin: 0 auto;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
    text-align: left;
    }
    
    ul#verlist
    {
    text-align: left;
    list-style: none;
    float:left;
    width: 120px;
    padding: 0;
    }
    
    ul#verlist li
    {
    display: block;
    margin: 0;
    padding: 0;
    }
    
    ul#verlist li a
    {
    display: block;
    width: 100%;
    padding: 0.5em 0.8em 0.5em 0.8em;
    border-top: 1px solid;
    color: #fff;
    text-decoration: none;
    background-color: #1F00CA;
    }
    ul#verlist li{
    	background-color: #1F00CA;
    	font-size:10px;
    	text-align:right;
    	border:1px red dotted;
    }
    
    Code (markup):

     
    Carl29, Feb 10, 2011 IP
  2. AtSeaDesign

    AtSeaDesign Active Member

    Messages:
    172
    Likes Received:
    2
    Best Answers:
    1
    Trophy Points:
    93
    #2
    You could use span inside the anchor tag:

    
    <a href="#"><span style="display:block;">sub text here</span></a>
    
    Code (markup):
    and style that span. Also remove the inline style and add it to a class.
     
    AtSeaDesign, Feb 10, 2011 IP
  3. indianartist

    indianartist Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    remove the css (display:block and padding: 0.5em 0.8em 0.5em 0.8em;) from ( ul#verlist li a ), it will work.
     
    indianartist, Feb 10, 2011 IP
  4. Carl29

    Carl29 Active Member

    Messages:
    114
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #4
    worked with <p style="...>, not span. thanks
     
    Carl29, Feb 11, 2011 IP
  5. AtSeaDesign

    AtSeaDesign Active Member

    Messages:
    172
    Likes Received:
    2
    Best Answers:
    1
    Trophy Points:
    93
    #5
    Not sure if placing a <p> tag inside href is compliant. Be sure to check across browsers to make sure it displays correctly.
     
    AtSeaDesign, Feb 12, 2011 IP
  6. deezon

    deezon Well-Known Member

    Messages:
    74
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    113
    #6
    Or you can define a separate class too :)
     
    deezon, Feb 13, 2011 IP
  7. Carl29

    Carl29 Active Member

    Messages:
    114
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #7
    nothing come up on the validator, so I'll keep the <p tag, I tried to creat a class, but it wont work styling outside of the html, strange
     
    Carl29, Feb 21, 2011 IP