Click here to Skip to main content
15,886,199 members
Home / Discussions / Web Development
   

Web Development

 
AnswerRe: top hosting companies Pin
Dalek Dave22-May-11 4:02
professionalDalek Dave22-May-11 4:02 
AnswerRe: top hosting companies Pin
beauxjames24-May-11 6:07
beauxjames24-May-11 6:07 
AnswerRe: top hosting companies Pin
mike231515-Jun-11 10:40
mike231515-Jun-11 10:40 
AnswerRe: top hosting companies Pin
Not Active15-Jun-11 12:07
mentorNot Active15-Jun-11 12:07 
AnswerRe: top hosting companies Pin
GregStevens13-Jul-11 4:12
GregStevens13-Jul-11 4:12 
Questionbest web analytics for .net Pin
Jassim Rahma22-May-11 3:33
Jassim Rahma22-May-11 3:33 
AnswerRe: best web analytics for .net Pin
JP_Rocks29-May-11 23:03
JP_Rocks29-May-11 23:03 
QuestionCSS div layout problem/question... [modified] ==> SOLVED but still have problems ==> ABANDONED Tables make it at the first attempt... Pin
Joan M18-May-11 21:00
professionalJoan M18-May-11 21:00 
I've abandoned... Tables make it easily...

Thank you for reading the post!






Hello,

I'm trying to create a news page.

That news page consists of a div (with a grey line on top) that occupies the whole width of the page.
Inside that div there are two divs more: on the left the time/date and on the right the new title.

Note: the layout I'm searching for is like the one you can see here[^].


OLD POST
The code I'm using is:

for (/*just to get all the news...*/)
{
  // updating the strDate and strTitle vars...

  // showing the information.
  echo('<div id="News">');
    echo('<div id="NewsDate">');
      echo(date('d/m/Y H:i:s',strtotime($strDate)));
    echo('<br><br></div>');
            
    echo('<div id="NewsTitle">');
      echo($strTitle);
    echo('</div>');
  echo('</div>');
}


Inside my CSS I have:
#News{
  margin: 30px;
  text-align:justify;
}

#NewsDate{
  position: relative;
	width: 160px;
}

#NewsTitle{
        position: relative;
	left: 161px;
}


Could you please tell me what I'm doing wrong?

I've tried to search for tutorials in the Internet, probably today I'm too sleepy or something, but I'm not getting this...

Thank you in advance! Thumbs Up | :thumbsup:

SOLUTION APPLIED
The solution has been to change the # for . in the css file and change id to class in the HTML and creating an outer div with a specified height.

Here I'm pasting the css changes I've made:

.News{
  border-top: 1px solid #DBDBDB;
  width: 760px;
	position: relative;
	height: 40px;
}

.NewsDate{
	width: 140px;
	position: absolute;
	top: 10px;
	left: 10px;
}

.NewsTitle{
	width: 599px;
	position: absolute;
	top: 10px;
	left: 141px;
	height: auto;
}


NEW PROBLEM
If you take a look at the web page[^] you will see that there are news/rows in different heights.

I'm interested on getting that behavior. The problem that I can see here is that if I remove the "height: 40px;" content in the OuterDiv, then all the text is rendered in the same line... Dead | X|

Any Div foo that I should be aware of? Ideas are welcome... I can't even imagine how to search that in Google... Unsure | :~

Thank you in advance... Rose | [Rose]
[www.tamelectromecanica.com] Robots, CNC and PLC machines for grinding and polishing.
modified on Thursday, May 19, 2011 11:32 AM

AnswerRe: CSS div layout problem/question... [modified] Pin
Peter_in_278018-May-11 21:15
professionalPeter_in_278018-May-11 21:15 
GeneralRe: CSS div layout problem/question... Pin
Richard MacCutchan18-May-11 21:47
mveRichard MacCutchan18-May-11 21:47 
GeneralRe: CSS div layout problem/question... Pin
Peter_in_278018-May-11 21:58
professionalPeter_in_278018-May-11 21:58 
Questionwhere is it hosted?! Pin
Jassim Rahma18-May-11 7:10
Jassim Rahma18-May-11 7:10 
AnswerRe: where is it hosted?! Pin
Richard MacCutchan18-May-11 7:43
mveRichard MacCutchan18-May-11 7:43 
AnswerRe: where is it hosted?! Pin
JHizzle18-May-11 22:26
JHizzle18-May-11 22:26 
GeneralRe: where is it hosted?! Pin
Jassim Rahma18-May-11 22:40
Jassim Rahma18-May-11 22:40 
GeneralRe: where is it hosted?! Pin
GenJerDan19-May-11 7:00
GenJerDan19-May-11 7:00 
AnswerRe: where is it hosted?! Pin
Dalek Dave22-May-11 4:08
professionalDalek Dave22-May-11 4:08 
AnswerRe: where is it hosted?! Pin
Luc Pattyn22-May-11 5:52
sitebuilderLuc Pattyn22-May-11 5:52 
AnswerRe: where is it hosted?! Pin
5fingers2-Jun-11 20:03
5fingers2-Jun-11 20:03 
QuestionDesigning a website for mobile devices Pin
Gregory Gadow18-May-11 6:31
Gregory Gadow18-May-11 6:31 
AnswerRe: Designing a website for mobile devices Pin
Marijan Ivicevic - Bakulic7-Jun-11 1:46
Marijan Ivicevic - Bakulic7-Jun-11 1:46 
AnswerRe: Designing a website for mobile devices Pin
Gerben Jongerius7-Jun-11 23:38
Gerben Jongerius7-Jun-11 23:38 
Questionare you on dedicated host? Pin
Jassim Rahma15-May-11 3:47
Jassim Rahma15-May-11 3:47 
AnswerRe: are you on dedicated host? Pin
Gerben Jongerius7-Jun-11 23:40
Gerben Jongerius7-Jun-11 23:40 
QuestionRackspace - are they cheating? Pin
Jassim Rahma15-May-11 3:30
Jassim Rahma15-May-11 3:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.