SunQuest
           CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 3rd, 2003, 11:34 PM
roongpatoong roongpatoong is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 4 roongpatoong User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
dumb css question

hey there
i am new to css and i am stuck on something i dont understand well.

i am trying to do this without the use of tables at all!

in the same <div> i want to be able to align one section of text to the left - and another section of text to the right.

it would be super easy with tables and simply two <td>'s in a <tr> with appropriate align: left/right options.

but whenever i add two <p> blocks to the <div> block - they get added one on top of the other - and the text in the <p> blocks dont get aligned left/right.

here are my styles and snippet of code:
div.news {
margin: 0px;
padding: .6em;
background-color: #354f7e;
}
p.headline {
display: inline;
postion: relative;
left: 5px;
background-color: #354f7e;
color: white;
text-align: left;
}
p.date {
display: inline;
background-color: #354f7e;
color: white;
text-align: right;
}

<div class="news">
<p class="headline">Microsoft go bankrupt</p>
<p class="date">24 May 2003</p>
</div>


this gives me the headline and date positioned correctly vertically, but the two <p>'s are joined together in the center instead of being aligned left and right.

Last edited by roongpatoong : October 3rd, 2003 at 11:37 PM.

Reply With Quote
  #2  
Old October 4th, 2003, 01:51 AM
kk5st's Avatar
kk5st kk5st is offline
Thanks Johnny Hart (BC) R.I.P.
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: May 2003
Location: Dallas
Posts: 4,539 kk5st User rank is Colonel (50000 - 60000 Reputation Level)kk5st User rank is Colonel (50000 - 60000 Reputation Level)kk5st User rank is Colonel (50000 - 60000 Reputation Level)kk5st User rank is Colonel (50000 - 60000 Reputation Level)kk5st User rank is Colonel (50000 - 60000 Reputation Level)kk5st User rank is Colonel (50000 - 60000 Reputation Level)kk5st User rank is Colonel (50000 - 60000 Reputation Level)kk5st User rank is Colonel (50000 - 60000 Reputation Level)kk5st User rank is Colonel (50000 - 60000 Reputation Level)kk5st User rank is Colonel (50000 - 60000 Reputation Level)kk5st User rank is Colonel (50000 - 60000 Reputation Level)kk5st User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Month 2 Days 30 m 39 sec
Reputation Power: 597
Try this.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4 Final//EN">
<html> <head>
<title></title>

<style type="text/css">

  body { paddding: 0px;
         margin: 0px;}

  .news { margin: 0px;
          padding: .6em;
          height: 1.2em;
          background-color: #354f7e;}

  .headline { width:45%;
              float:left;
              color: white;}

  .date { width: 45%;
          float: right;
          color: white;
          text-align: right;}

</style>
</head>
<body>
  <div class="news">
    <div class="headline">Microsoft go bankrupt</div>
    <div class="date">24 May 2003</div>
  </div> 

</body>
</html>


May be viewed at http://garyblue.port5.com/webdev/dumbcss.html

cheers,

gary
__________________
There are those who manage to build a web site without knowing what they're doing; thereby proving to themselves they do, indeed, know what they're doing.

Ask a better question, get a better answer.

Last edited by kk5st : October 4th, 2003 at 02:19 AM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > dumb css question


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway