By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,867 Members | 1,964 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,867 IT Pros & Developers. It's quick & easy.

alignment questions

P: n/a
J
I've defined an area where I want a logo, and some text displayed
underneath the logo.
See code below. Questions:
1. How can I code in the style section that I want the img aligned 'right'.
(Instead of setting this in the body)?
2. How can I code in the style section that I want the <p> info aligned
'center'?
3. The general question is, what reference can I use to find what all the
possible properties are available (i.e. can I set an 'align: right' in the
'onepieceheader p' section)?
<style type=text/css>
#onepieceheader {
position: absolute;
top: 0;
left: 60;
height: 127px;
width: 600px;
}
#onepieceheader p {
font-weight: bold;
}
</STYLE></head>

<body>
<div id="onepieceheader">
<img align="right" src="companylogo.gif">
<p>we make it right</p>
</div>

Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
In article J wrote:
I've defined an area where I want a logo, and some text displayed
underneath the logo.
See code below. Questions:
1. How can I code in the style section that I want the img aligned 'right'.
(Instead of setting this in the body)?
img {float:right;}
2. How can I code in the style section that I want the <p> info aligned
'center'?
p {text-align:center;}

If you want it to align in the center of space left, add:

p {padding-right:<imgwidth>px}

elsif you want that P below image add:

p {clear:left}

3. The general question is, what reference can I use to find what all the
possible properties are available (i.e. can I set an 'align: right' in the
'onepieceheader p' section)?
http://www.w3.org/TR/CSS1
http://www.w3.org/TR/CSS2/
http://www.w3.org/TR/CSS21/
<style type=text/css>
#onepieceheader {
position: absolute;
top: 0;
left: 60;
height: 127px;
width: 600px;
}
#onepieceheader p {
font-weight: bold;
}
</STYLE></head>

<body>
<div id="onepieceheader">
<img align="right" src="companylogo.gif">
<p>we make it right</p>
</div>
Are you sure this is paragraph, and not heading? It sure looks like
heading. Why not:
<style type=text/css>
div.header { margin-top:0;
margin-left: 60;
height: 127px;
width: 600px; /* this is not good, use max-width instead*/
font-weight: bold;
font-size:100%; }
</style></head> <body>

<div class="header"><img src="companylogo.gif"><h1>we make it right</h1>
</div>
--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on yksityinen
tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään.

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.