Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-05-2012, 01:02 PM   PM User | #1
faheem00
New to the CF scene

 
Join Date: Nov 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
faheem00 is an unknown quantity at this point
Unhappy Two div within a div : fixing text positions

Hello, I am a noob when it comes to HTML and CSS, and I need some help. What I have been trying to do is that I created a div with a width of whole screen and height of 80px. Then I proceeded to create two div within that div - those two div will be positioned in the same line, not up and down. Now I can do that, but the problem are the words. When I resize the browsers to reduce width, the texts all begin to shrink, meaning they become positioned one after another. I think these two attached images will explain my problem.




Now what I want to do is that I want to place "Blog Outta Hell" on the left side of the screen and the "Beware" staff on the right side of the screen, and I don't want them to be fixed or absolute. I want those two div within the main div and not exceeding the boundary. I also want those words not to be placed one after another when I resize my browser window, meaning I want them to be constant. What can I do to achieve that? I can show you guys what have I done so far with CSS, please check my code out and help me find this solution.

Code:
div#header   //this is the main div
{
  width:100%;
  height:80px;
  display:block;
  background-color:#3B5998;
  position:relative;
}
div#header_content   //this is the left div
{
  font-family:"lucida grande",tahoma,verdana,arial,sans-serif;
  float:left;
  font-size:41px;
  font-weight:bolder;
  color:white;
  outline:none;
  padding-left:15px;
  padding-top:15px
}
div#header_content2{  //this is the right div
  font-size:21px;
  text-align:right;
  font-family:"tahoma",Helvetica,serif;
  color:#99F5FF;
  outline:none;
  padding-right:20px;
  padding-top:25px;
  text-shadow:2px 2px 2px #31CDDE;
}

Please help me find this solution, this has been bugging me for days. Thanks in advance!
faheem00 is offline   Reply With Quote
Old 11-05-2012, 04:03 PM   PM User | #2
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Hello faheem00,
Maybe putting a min-width on your #header will do what you want.
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Old 11-05-2012, 04:31 PM   PM User | #3
faheem00
New to the CF scene

 
Join Date: Nov 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
faheem00 is an unknown quantity at this point
Hey Excavator, thanks for the tip now the two div are not placed upon one another regardless the size of the browser window.

But another problem has surfaced now. I want the "beware" stuff to not move when I resize the window, I want it to stay at the right side of the screen, but it still moves to left. I've tried inline, min-width, span, margin, absolute and fixed position, but the text still moves with the browser. Can you or anyone help me to keep the text fixed regardless the size of the browser window? Thanks.
faheem00 is offline   Reply With Quote
Reply

Bookmarks

Tags
css, div, html, position, text

Jump To Top of Thread


Thread Tools
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

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

Forum Jump


All times are GMT +1. The time now is 11:37 AM.


Advertisement
Log in to turn off these ads.