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

  Quote
<?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
https://forums.phpfreaks.com/topic/39662-align-problem/
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
https://forums.phpfreaks.com/topic/39662-align-problem/#findComment-191558
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.