• This is the error.

    # Line 154, Column 10: ID “footer” already defined

    <div id=”footer”>

    ?

    An “id” is a unique identifier. Each time this attribute is used in a document it must have a different value. If you are using this attribute as a hook for style sheets it may be more appropriate to use classes (which group elements) than id (which are used to identify exactly one element).
    # Info Line 34, Column 9: ID “footer” first defined here

    <div id=”footer”>

    I have used again in the header <div id=”footer”> because i wanted to look just the same as the footer. What can i use instead of that and have the same look?

    My link: https://www.kiano.ro

    Thank you.

Viewing 9 replies - 1 through 9 (of 9 total)
  • You need to change both <div id="footer"> to a more generic class like <div class="section"> and apply your current styles for the footer to the new class section.

    You can have more than one class on the page, where as id‘s you can only have one.

    So you make the layout like this:

    <div class="section" id="header">
    
    </div>
    
    ...code...
    
    <div class="section" id="footer">
    
    </div>

    but where can i make this changes? I simply put your code from above where i have <div id=”footer”> or i have to make diferent changes somewhere?

    Your problems have little to do with a simple dupicated call to a div id of footer. You have to make changes in CSS. All <div id="footer"> does is call the #footer in CSS. If you simply duplicate footer, you’re duplicating CSS, and that’s what is messing up your layout. Footer uses CS that’s appropriate for the layout at that point. It’s not automatically appropriate for the header area.

    Yes, but what should i do to have the same look but not duplicate footer? nouveller tryied to explain me but i did understand. Should i only copy/paste <div class=”section” id=”header”> everywhere i have <div id=”footer”> or i have to do some changes somewhere else so that section class to take action?

    You have to make changes in CSS. Look at your style.css in your theme folder.

    Yes, i know style.css but it is not so simple. You have to tell me where to go. I don`t know what to do….

    This is what i have in style.css about footer:

    #footer {
    width: 940px;
    margin: 0px auto;
    padding-bottom: 10px;
    text-align: right;
    font-size: 0.9em;
    color: #9e9e9e;
    }

    #footer a {
    color: #9e9e9e;
    }

    #footer a.valid {
    padding-left: 16px;
    background: transparent url(images/tick.png) no-repeat 0% 50%;
    }

    #footer a.valid:hover {
    background: transparent url(images/tick-hover.png) no-repeat 0% 50%;

    In your stylesheet, change every reference to #footer to .section. In your template files, change every reference to <div id="footer> to <div class="section">

    I did that but it changes the way it looks. It doesn`t look the same.

    Delete that CSS you posted above and replace it with:

    .section {
    width: 940px;
    margin: 0px auto;
    padding-bottom: 10px;
    text-align: right;
    font-size: 0.9em;
    color: #9e9e9e;
    }
    
    .section a {
    color: #9e9e9e;
    }
    
    .section a.valid {
    padding-left: 16px;
    background: transparent url(images/tick.png) no-repeat 0% 50%;
    }
    
    .section a.valid:hover {
    background: transparent url(images/tick-hover.png) no-repeat 0% 50%;

    Then in your header.php or footer.php files replace

    <div id="footer"> with <div class="section">

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘error found in xhtml. how can i solve it?’ is closed to new replies.