Forums

[resolved] Adding div class to front page (4 posts)

  1. veliapola
    Member
    Posted 4 years ago #

    I have created an intro that appears once only on the home page with a div class and have this on page template:

    <div class="intro">

    <?php include_once(TEMPLATEPATH.'/intro.php');?></div>

    I would like to set different margins or padding for the intro than the balance of the body of text. When I add either (or even a border) it affects the entire page instead of just the intro.

    website: http://www.golfforthegood.net/test/

  2. Kafkaesqui
    Moderator
    Posted 4 years ago #

    Looking at the source of your page:

    <div class="intro">
    
    <div id="introid">
    
    	<div class="intro"><h1>Welcome</h1>
    		<br></br>

    Two intro divs. I didn't look over the entire source, but I imagine the first one is affecting the entire doc, or a large portion of it.

  3. veliapola
    Member
    Posted 4 years ago #

    Thanks, I had removed the second one from the css but had left it in the php file. It's closer now but I'm still getting a double border and padding isn't working properly... but without the border I can live with it! Many thanks

  4. Maxaud
    Member
    Posted 4 years ago #

    you had two intro id's in your css? That's completely unneccessary.

    browsers will only use one of them in your style sheet.

    Make it so you only have one div with the intro call as it's applying the css to both dividers.

Topic Closed

This topic has been closed to new replies.

About this Topic