473,398 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Problems with floats and lists HTML and CSS

2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>About</title>

<style>
body {
background:#000;
color: #FFF;
font-family:Verdana, Geneva, sans-serif;
font-size:16px;
margin:0;
}

#container {
float:left;
width:700px;
overflow:hidden;
margin:0 auto;
}

.yellowtext {
color:#FF0;
}

.fancyyellowtext {
color:#FF0;
font-size:20px;
}

#Bullets
{
float:right;
margin-right:50;
width:400;
}
#Bullets ul {
margin: 0;
list-style:none;
}

#Bullets ul ul
{
margin-left: 20px;
list-style:outside;
list-style:square;
}

#Bullets ul ul ul
{
margin-left: 40px;
list-style:outside;
list-style:square;
}
</style>
</head>

<body>
<div id="container">

<div>
<p class="fancyyellowtext" style="text-align:center; font-size:22px; margin:0;"><i>
Title/Heading</i></p>
<img src="Description.png" width="700" height="250"></img>
</div>

<div style="margin-left:50; float:left;">
<img src="1stPic.png" width="200" height="200"></img><br/>
<img src="2ndPic.png" width="200" height="200"></img><br/>
<img src="3rdPic.png" width="200" height="200"></img>
</div>

<div id="Bullets">
<ul>
<li><p class="yellowtext">Heading<i>Italics</i></p>
<ul>
<li>Bullet1</li>
<li>Bullet2</li>
</ul></li>
<li><p class="yellowtext">2ndHeading<i>Italics</i></p>
<ul>
<li>Bullet1</li>
<li>Bullet2:
<ul>
<li>Bullet...</li>
<li>Bullet...</li>
<li>Bullet...</li>
<li>Bullet...</li>
<li>Bullet...</li>
<li>Bullet...(This one is going to be a long one just to show you what happens...)</li>
</ul></li>
</ul></li>
</ul>
</div>


</div>
</body>
</html>
<!--When The bullets have enough content to make the text wrap around, the entire div is pushed below the first div. If they're all short enough (they won't be realistically), the list will be pushed too far to the right of the screen. The strange thing is that if I switch the DOCTYPE and the <html> tag, everything is fixed. I know that I shouldn't do something like that - is there any other way to solve the problem? You can copy and paste the code into the Tryit HTML Editor right here:

http://www.w3schools.com/html/tryit.asp?filename=tryhtml_basic

Thanks in advance.
Nov 25 '11 #1

✓ answered by drhowarddrfine

Because you didn't set units, px, on the Bullets width or margin. Validating would have shown you that.

2 1877
drhowarddrfine
7,435 Expert 4TB
Because you didn't set units, px, on the Bullets width or margin. Validating would have shown you that.
Nov 25 '11 #2
C Pear
2
Thanks a lot! Short and to the point. I'll be more careful in the future.
Nov 26 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: lawrence | last post by:
not sure if this is a PHP or HTML question. PHP sessions usually put a "?" after the url and then the session number. Most validators choke on the "?". What should I use instead? And where is the...
20
by: Lucas Raab | last post by:
I'm done porting the C code, but now when running the script I continually run into problems with lists. I tried appending and extending the lists, but with no avail. Any help is much appreciated...
2
by: Andrew Parish | last post by:
I have a page with an input text box and a button which validates the text (see below). If I click inside the text box, the button is highlighted. If I enter some text inside the box and press...
9
by: Dave H | last post by:
Hello, I have a query regarding definition lists. Is it good practice semantically to use the dt and dd elements to mark up questions and answers in a frequently asked questions list, or FAQ? ...
5
by: John Topley | last post by:
Hi, I'm doing some work in an intranet environment where I'm forced to use IE 6.0. Is it possible to style (unordered) nested lists so that the inner list items have a different appearance to...
33
by: Jim Cobban | last post by:
I cannot get Netscape 4.79 to properly display the ordered list in the following fragment. <P>Get a specific portion of the date. Depending upon the value of index: <ol start=0> <li>complete...
5
by: Bikhod | last post by:
Hi Refering to my sample below, can anyone please tell me why my list is not appearing correctly on my VS.NET generated web site? The summary and remarks are fine, but the HTML is showing the...
1
by: Al Wilkerson | last post by:
Hey, I have a Web Form with a drop down list, textbox, and search button. When click the search button an SQL server database is queried fordata. Once I have the data in a dataset I use the...
0
by: Yabedabe | last post by:
Hello there, I have a strange problem (possible bug?) to display two HTML Help files at the same time. To reproduce this problem. Create a new VB.Net solution. Place two buttons on the form....
0
by: micmit | last post by:
I wanted to avoid any HTML file creation , so initial HTML was formed as a string and assigned to DocumentText. After that the aim was to manipulate with html using DOM . It turned out...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.