|
Web design and Programming Discuss website creation and other programming topics. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||
|
Placing text on seperate sides of a <div>
http://www.teamdual1ty.com/college/index.html
I want the headers of the news pieces to have the title on the left, and the date on the right. How can i do it? I think i did read the code somewhere a while ago, so im gonna go and look for it aswell. |
#2
|
||
|
<span class="newsTitle">Welcome</span><span class="newsDate">February 5th</span>
.newsTitle { text-align:left; } .newsDate{ text-align:right;}
__________________
|
#3
|
|||
|
Quote:
.newsTitle { text-align:left; } .newsDate{ text-align:right;}
__________________
|
#4
|
|||
|
Now, I really like that. Nice and simple
__________________
Quote:
|
#5
|
||
|
Sweet, Thanks ath
|
#6
|
||
|
Hmm its not working 8-)
i put the CSS in my external style sheet as you typed it, and the span tags like this: PHP Code:
|
#7
|
||
|
Yeah just noticed it.... weird.
Let me try some other stuff.
__________________
|
#8
|
||
|
Grr I thought I had done something like that before!!!
Anywho, this works...not as pretty as I wanted but... the reason the above CSS won't work is because it is aligning the text inside of the span and not the span itsself. I assume you could do this with margins and shiz as well but this was the easiest way. Code:
.newsHead { padding: 2px; width: 400px; border:1px solid black; } .newsTitle{ float: left; } .newsDate{ float: right; }
__________________
Last edited by atholon; 02-05-2009 at 11:49 PM. |
#9
|
||
|
Yeah that works, thanks
I have another problem now. The div isnt stretching across the whole space, its ending before the text margin. Ive tried width to the div but that didn't do anything. |
#10
|
||
|
Can you show me what you mean? And what HTML you are using?
__________________
|
#11
|
||
|
http://www.teamdual1ty.com/college/index.html
The red bar with the headline and date on doesnt reach across far enough. on my index.html page, ive got: PHP Code:
and on the news.html page, i have: PHP Code:
|
#12
|
||
|
First off you should be using CSS for the width
width: 540px;
__________________
|
#13
|
||
|
Ah fixed it. It was because i copied your css for the div, and forgot to change the width from there ^^
Im still a major css noob, still making the transition |
#14
|
||
|
NP's I am still a n00b
__________________
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Dave61 <<< happy birthday >>> | MERMITE | General Chat | 4 | 06-27-2010 06:44 PM |
News Flash <<< Dem Shuttind Down For Ever >>> | silentraiders | News | 4 | 04-28-2005 07:21 PM |
<<>> News Flash <<>> | silentraiders | Gaming Talk | 0 | 08-20-2004 04:24 AM |
<<>>BHD GLITCH<<>> | Stu | Delta Force | 7 | 10-24-2003 01:22 PM |