Go Back   Novahq.net Forum > Computers > Web design and Programming
FAQ Community Calendar Today's Posts Search

Web design and Programming Discuss website creation and other programming topics.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-05-2009, 10:53 AM
.Simon. is offline .Simon.

Join Date: Nov 2003
Location: Wales
Posts: 4,801

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.
__________________

Quote:
Originally Posted by Steve View Post
next person to post half naked gets banned
Reply With Quote
  #2  
Old 02-05-2009, 12:37 PM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
<span class="newsTitle">Welcome</span><span class="newsDate">February 5th</span>
.newsTitle { text-align:left; }
.newsDate{ text-align:right;}
__________________
Reply With Quote
  #3  
Old 02-05-2009, 02:51 PM
Acid is offline Acid

Join Date: Apr 2002
Posts: 853

Send a message via ICQ to Acid
Quote:
Originally posted by atholon
<span class="newsTitle">Welcome</span><span class="newsDate">February 5th</span>
.newsTitle { text-align:left; }
.newsDate{ text-align:right;}
This part goes in the style tag above the head tag? Or even maybe in a style sheet?

.newsTitle { text-align:left; }
.newsDate{ text-align:right;}
__________________
Reply With Quote
  #4  
Old 02-05-2009, 03:06 PM
EDGE is offline EDGE
EDGE's Avatar

Join Date: Feb 2003
Location: North Carolina
Posts: 7,184

Send a message via ICQ to EDGE Send a message via AIM to EDGE Send a message via Yahoo to EDGE
Now, I really like that. Nice and simple
__________________
Quote:
Voltaire
It is forbidden to kill; therefore all murderers are punished unless they kill in large numbers and to the sound of trumpets.
Reply With Quote
  #5  
Old 02-05-2009, 05:34 PM
.Simon. is offline .Simon.

Join Date: Nov 2003
Location: Wales
Posts: 4,801

Sweet, Thanks ath
__________________

Quote:
Originally Posted by Steve View Post
next person to post half naked gets banned
Reply With Quote
  #6  
Old 02-05-2009, 05:53 PM
.Simon. is offline .Simon.

Join Date: Nov 2003
Location: Wales
Posts: 4,801

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:
<div class="newsHead"><span class="newsTitle">Welcome</span><span class="newsDate">February 5th</span> </div
__________________

Quote:
Originally Posted by Steve View Post
next person to post half naked gets banned
Reply With Quote
  #7  
Old 02-05-2009, 11:37 PM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
Yeah just noticed it.... weird.
Let me try some other stuff.
__________________
Reply With Quote
  #8  
Old 02-05-2009, 11:43 PM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
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.
Reply With Quote
  #9  
Old 02-06-2009, 05:32 AM
.Simon. is offline .Simon.

Join Date: Nov 2003
Location: Wales
Posts: 4,801

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.
__________________

Quote:
Originally Posted by Steve View Post
next person to post half naked gets banned
Reply With Quote
  #10  
Old 02-06-2009, 09:05 AM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
Can you show me what you mean? And what HTML you are using?
__________________
Reply With Quote
  #11  
Old 02-06-2009, 09:25 AM
.Simon. is offline .Simon.

Join Date: Nov 2003
Location: Wales
Posts: 4,801

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:
<td colspan="9" bgcolor="#311724" width="540" valign="top" align="center">


            <
iframe id="myframe" src="news.html" scrolling="no" marginwidth="0" marginheight="0"
             
frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:500; display:none">
            </
iframe>            


        </
td

and on the news.html page, i have:

PHP Code:
 <html>

<
head>
<
link rel="stylesheet" type="text/css" href="style.css" />
</
head>

<
body bgcolor="#311724">

    <
div class="newsHead" width="480"><span class="newsTitle">Welcome</span><span class="newsDate">February 5th</span> </div>

    <
class="news">
              
Text Here
    
</p>
    <
class="news">
               
Text Here
    
</p>


</
body>
</
html
__________________

Quote:
Originally Posted by Steve View Post
next person to post half naked gets banned
Reply With Quote
  #12  
Old 02-06-2009, 10:46 AM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
First off you should be using CSS for the width

width: 540px;
__________________
Reply With Quote
  #13  
Old 02-06-2009, 12:12 PM
.Simon. is offline .Simon.

Join Date: Nov 2003
Location: Wales
Posts: 4,801

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
__________________

Quote:
Originally Posted by Steve View Post
next person to post half naked gets banned
Reply With Quote
  #14  
Old 02-06-2009, 12:37 PM
atholon is offline atholon
"ath-hole"

Join Date: Jan 2003
Location: Failville.
Posts: 11,357

Send a message via MSN to atholon
NP's I am still a n00b
__________________
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -5. The time now is 07:32 PM.




Powered by vBulletin®