Jump to content

align problem


runnerjp

Recommended Posts

no matter how much i try i cant align to the right!! any idea why ( yes i know its really easy lol but im learning and been readin books like advised but in them this is supposed to work :S)

 

<body>
<div id="logo"><img src="http://www.runnerselite.com/images/LOGO.jpg" width="750" height="100" alt="RunnerElite logo"/>
</div>
<div id="runnerlogo">
<img src="http://www.runnerselite.com/images/runner.jpg" alt="Runner Logo"/></div>
<div id="info">
<?include("include/info.inc.php");?> </div>			

 

what i wanna do is align

<?include("include/info.inc.php");?>
to the right of my logo! yet when i add <P ALIGN="RIGHT">  it does nothin :S
Link to comment
Share on other sites

Are you wanting to align the entire div#info to the right of the logo or just the content of div#info right?  That is two different things...

 

If you want to align the content of div#info use text-align:right; in your css.  If you are wanting the entire div#info to align right of div#logo then you will need to use floats.

 

XHTML

<div id="logo">
    <img src="http://www.runnerselite.com/images/LOGO.jpg" width="750" height="100" alt="RunnerElite logo"/>
</div>
<div id="runnerlogo">
    <img src="http://www.runnerselite.com/images/runner.jpg" alt="Runner Logo"/>
</div>
<div id="info">
    <?include("include/info.inc.php");?>
</div>	
<div class="clear"></div>

 

CSS

div#logo {
  float: left;
  text-align:center;
  margin-top:0;
}

div#runnerlogo {
  float: left;
  margin-top:-9%; 
  margin-left:3%;
}

div#info {
  float: left;
  margin-top:-9%; 
  margin-right:10%;
}

div.clear {
  clear: left;
}

 

This is just ONE of many ways to do it.  This method floats all three boxes left and then clears the floats with div.clear.  Floats can be very tricky for a beginner so I HIGHLY suggest you do some reading on them and fully understand how they work.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.