Jump to content


css width problem


5 replies to this topic

#1 zetsumei

    Young Padawan

  • Publishing Betazoids
  • Pip
  • 269 posts
  • Gender:Male
  • Location:127.0.0.1

Posted 05 January 2007 - 07:27 PM

I'm trying to figure out why this is happening because I think I have the CSS code right. but if u view this you'll see the problem...the text exceeds the width of the box, I've never had any problems with the code I use, as I used to use it all the time.

heres my css code:
body {
	background-color: #000000;
	color: #;
	margin-left: auto;
	margin-right: auto;
	 }

#container {
	width: 500px;
	background-color: #000000;
	color: #;
	font-family: verdana;
	font-size: 10px;
	margin-left: auto;
	margin-right: auto;
		   }

#header {
	width: 500px;
	background-color: #;
	color: #;
	font-family: verdana;
	font-size: 10px;
		}

#navbar {
	width: 500px;
	background-color: #000000;
	color: #;
	font-family: verdana;
	font-size: 10px;
	text-align: left;
		}

.content {
	width: 500px;
	background-color: #000000;
	color: #;
	font-family: verdana;
	font-size: 10px;
		 }

.content2 {
	width: 500px;
	text-align: left;
		  }

.nav {
	list-style: none;
	 }

.nav li {
	float: left;
		}

.nav li a {
	padding: 5px;
	background-color: #000000;
	color: #;
	display: block;
		  }

.nav li a:hover {
	color: #;
	background-color: #333333;
				}

the problem is with the content section, it sticks out past the 500 width size...

Edited by zetsumei, 05 January 2007 - 07:28 PM.


#2 blacky

    Young Padawan

  • Members
  • Pip
  • 34 posts
  • Gender:Male

Posted 05 January 2007 - 09:48 PM

that always happens when a single word is longer than its container...

anyway, i'm not sure if you can stick an overflow on the horizontal scrollbar, but google it :P or i'm sure someone will post the code if it is possible

#3 zetsumei

    Young Padawan

  • Publishing Betazoids
  • Pip
  • 269 posts
  • Gender:Male
  • Location:127.0.0.1

Posted 05 January 2007 - 11:23 PM

oh thanks ill go look for an answer

#4 Sabu Kudo

    Young Padawan

  • Members
  • Pip
  • 54 posts
  • Gender:Male
  • Location:Austin, TX

Posted 06 January 2007 - 09:25 AM

umm...

try adding this to .content:
max-width: 500px;
overflow: hidden;


I'm not sure if it will work. but is should.

#5 Jacorre

    P2L Jedi

  • Members
  • PipPipPip
  • 824 posts
  • Gender:Male
  • Location:USA
  • Interests:Computers, Technology, Internet, Graphic/Web Design, Music, Soccer

Posted 06 January 2007 - 12:22 PM

It's possible that there's margin or padding settings with some of the other things on the page which is causing the 500 width to break. You may want to play around with those settings.

#6 fiv3isaliv3

    Young Padawan

  • Members
  • Pip
  • 258 posts
  • Gender:Male

Posted 09 January 2007 - 12:16 AM

What browser are you using?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users