/    Sign up×
Community /Pin to ProfileBookmark

Help with no table design

Ok, after years of table corruption ? I am going to try my first 100% css based website. Loving every second of it, except this second. I can’t seem to get this to work.

Here’s my page code:

[code=php]
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>

<html>
<head>
<title>Who’s Who User Management</title>
<link rel=”stylesheet” type=”text/css” href=”style.css” />
</head>
<body>

<div id=”center”>
<h1>Who’s Who User Management System</h1>

<form>
<div id=”leftside”>
First Name: <input type=”text”>
</div>

<div id=”rightside”>
Address: <input type=”text”>
</div>

</form>

</div>

</body>
</html>
[/code]

Here’s my CSS file:

[code=php]
#center
{
background: skyblue;
width: 600px;
border: 1px solid black;
padding: 10;
}

#leftside
{
position:absolute; left:10px; top:70px;
background: yellow;
width: 250px;
border: 1px solid black;
padding: 10;
}

#rightside
{
position:absolute; left:300px; top:70px;
background: yellow;
width: 250px;
border: 1px solid black;
padding: 10;
}

h1
{
font-family: arial;
color: black;
}

form, input
{
font-family: arial;
font-size: 12px;
font-color: black;
}
[/code]

Here’s the problem, (you can see my attachment for the pic) I need the two yellow boxes to be INSIDE the blue box as a part of it. If I do relative instead of absolute, the first box works great, however the second box becomes relative to the first box, not to the skyblue box as it should. I have the yellow box <div> inside the original <div> but it doesnt seem to matter. How can I make BOTH boxes relative to the blue, or a part of the blue box. Do you see what I mean?

[upl-file uuid=dab2af26-c48b-4a59-b429-f753b6ecf7ca size=18kB]ts10.jpg[/upl-file]

to post a comment
CSS

4 Comments(s)

Copy linkTweet thisAlerts:
@ExuroAug 27.2003 — I don't believe there's any way to make both relative to the blue box. But, you could just change the height of the blue box to 120px and it seems to work fine:
[code=php]
#center
{
background: skyblue;
width: 600px;
height: 120px;
border: 1px solid black;
padding: 10;
}
[/code]

Also, I noticed that if the user has their browser text size on anything above "Smaller", the word System gets put under the Login box. You might either want to make the blue box wider, or specify a font size for the text so it doesn't ever wrap.
Copy linkTweet thisAlerts:
@JoshSep 01.2003 — Try this...
[code=php]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Who's Who User Management</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<meta name="author" content="Joshua J Mallory ([email protected])" />
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="main">
<h1>Who's Who User Management System</h1>
<form action="">
<div class="left">
First Name: <input type="text" />
</div>
<div class="right">
Address: <input type="text" />
</div>
</form>
<br />
<br />
<br />
</div>
</body>
</html>
[/code]

and this...
[code=php]
div.main {
background-color: #87ceeb;
color: #000000;
border: #000000 solid 1px;
padding: 10px;
width: 600px;
font-family: Arial, Verdana, serif;
}
div.left {
background-color: #ffff00;
color: #000000;
border: #000000 solid 1px;
padding: 10px;
width: 250px;
float: left;
}
div.right {
background-color: #ffff00;
color: #000000;
border: #000000 solid 1px;
padding: 10px;
width: 250px;
float: right;
}
[/code]

Let me know if it works for you
Copy linkTweet thisAlerts:
@JoshSep 01.2003 — Here's the screenshot using Internet Explorer.

[upl-file uuid=297e0e4e-866d-48ed-943e-938db47c39bf size=17kB]ts10_ie.png[/upl-file]
Copy linkTweet thisAlerts:
@JoshSep 01.2003 — Here's the same one using Netscape Navigator.

[upl-file uuid=82751560-b427-40ee-b4c6-62297b291c11 size=32kB]ts10_nn.png[/upl-file]
×

Success!

Help @ts10 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...