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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Nov 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problem with <a href...> doesn't take my class attributes.

    Hi guys

    I don't understand why my <a href...> tag doesn't take the style I gave him in my CSS. Is it possible that the space between the <li> and the <a href...> is the cause? If yes how can I solve this in the CSS?

    Here is my CSS code :

    Code:
    div.mod_login 
    {
    position: absolute;
    top: 5px;
    z-index:-1;
    left: 720px;
    width: 150px;
    height: 150px;
    color:blue;
    border:0px;
    text-decoration: underline; color: blue;
    }
    
    div.mod_login a:link, a:visited, a:hover
    {
    	text-decoration:underline; font-size: 10px; color: white;
    }
    
    div.mod_login li, ul
    {
    	text-decoration:underline; font-size: 10px; color: white;
    }
    
    div.mod_login li a:link
    {
    	text-decoration:underline; font-size: 10px; color: white;
    }
    here is the source code :
    Code:
    <div class="mod_login">
    <form action="http://127.0.0.1/dev/index.php?option=com_user&amp;task=login" method="post" name="login" id="login">
    <label for="username_vmlogin">Identifiant</label><br/>
    <li> <a href="/dev/index.php?">Inscription</a></li>
    </ul>		
    </form>
    </div>

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,673
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello akaii,
    It's hard to tell how your putting that in your site... the bits that you quote work when I put them into a test page.
    It is not valid code.

    Just to show you the space doesn't matter...
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    html, body {
    	font: 100.1% "Comic Sans MS";
    	background: #FC6;
    }
    * {
    	margin: 0;
    	padding: 0;
    	border: 0;
    	outline: 0;
    }
    #container {
    	height: 400px;
    	width: 1200px;
    	margin: 30px auto;
    	background: #999;
    	font-size: 0.8em;
    	position: relative;
    }
    div.mod_login 
    {
    position: absolute;
    top: 5px;
    /*z-index:-1; (just to make things visible*/
    left: 720px;
    width: 150px;
    height: 150px;
    color:blue;
    border:0px;
    text-decoration: underline; color: blue;
    }
    
    div.mod_login a:link, a:visited, a:hover
    {
    	text-decoration:underline; font-size: 10px; color: white;
    }
    
    div.mod_login li, ul
    {
    	text-decoration:underline; font-size: 10px; color: white;
    }
    
    div.mod_login li a:link
    {
    	text-decoration:underline; font-size: 10px; color: white;
    }
    </style>
    </head>
    <body>
        <div id="container">
            <div class="mod_login">
                <form action="http://127.0.0.1/dev/index.php?option=com_user&amp;task=login" method="post" name="login" id="login">
                <label for="username_vmlogin">Identifiant</label><br/>
                    	<li>                         
                        
                        
                                                 <a href="/dev/index.php?">Inscription</a></li>
                    </ul>		
                </form>
            </div>
        <!--end container--></div>
    </body>
    </html>
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,277
    Thanks
    28
    Thanked 272 Times in 266 Posts
    Quote Originally Posted by akaii View Post
    I don't understand why my <a href...> tag
    "a element" would be correct terminology (versus "<a href...> tag").

    Quote Originally Posted by akaii View Post
    doesn't take the style I gave him in my CSS. Is it possible that the space between the <li> and the <a href...> is the cause?
    My guess is that your selector was miswritten. The first code block below should be written as the second:

    Code:
    div.mod_login a:link, a:visited, a:hover { /* ... */ }
    Code:
    div.mod_login a:link, div.mod_login a:visited, div.mod_login a:hover { /* ... */ }
    Given that code, you may want to just use one of the following though to simplify your code:

    Code:
    div.mod_login a["href"] { /* ... */ } /* more specific */
    div.mod_login a { /* ... */ } /* MSIE6 compatible */
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #4
    New to the CF scene
    Join Date
    Nov 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes thanks arbitrator and all!!


  •  

    Posting Permissions

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