0

Hello,

I am developing php web application. I have a form with the fields. All the fields are in a table. Now to create a suggestion box for a text field which has to give auto complete results, my css is ruining the complete page. I just started learning CSS and I am not a pro at it.

For the suggestion box I have created a div tag which is invisible and has some width etc.,
the following the table and a field in the form

<tr>
<td style='width: 150px'><label id = 'Label7'>Tags&nbsp<font color='red'><em>*</em></label></td>
<td><input name='tag' style='width: 150px' tabindex='7' type='text' onkeyup='showTags(this.value)'/>
<div id ='suggestionDiv'></div></td>
</tr>

Keeping the div in the column expands the row and pushes the rest of the elements to the bottom of the page.
Keeping the div tag in a new row pushes the complete table to the bottom of the page. And my page container doesn't expand if the form size increases. I need some help with it.

Attached are is my css and the image file for clear picture of what I am saying. I need quick help from experts. I would appreciate your help.

Thanks

Attachments Screenshot-2.png 103.64 KB
/* 
    Document   : styleSheet
    Created on : Jan 31, 2011, 11:55:41 AM
    Author     : harish
    Description:
        Purpose of the stylesheet follows.
*/

/* 
   TODO customize this sample style
   Syntax recommendation http://www.w3.org/TR/REC-CSS2/
*/

#menu {
	background-image: url('images/head.png');
	background-repeat: no-repeat;
	width: 966px;
	height: 35px;
	color: #FFFFFF;
}
#footer {
	width: 966px;
	height: 45px;
	margin-right: auto;
	margin-left: auto;
	background-image: url('images/footer.png');
}
#leftnav {
	width: 200px;
	float: left;
}
#maincontent {
	padding: 50px 0px 20px 20px;
	margin-left: 200px;
        position: absolute;
}
#container {
	background-image: url('images/header.png');
	top: 10px;
	bottom: 10px;
	background-repeat: repeat-y;
	background-color: #FFFFFF;
	margin-right: auto;
	margin-left: auto;
	width: 966px;
	height: 450px;
}
p.copyright {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 11px;
	text-align: left;
	padding-left: 5px;
	padding-top: 10px;
}
#menu a {
	display: block;
	float:left;
	background-image: url('images/img01.png');
	background-repeat: no-repeat;
	height: 18px;
	padding: 18px 100px 0px 100px;
	font-family: 'Times New Roman',Times,serif;
	font-size: 12px;
	color: #FFFFFF;
}
#menu ul {
	margin: 0;
	padding: 0;
	list-style: none;
}
#menu li {
	display: inline;
	right: 20px;
	left: 100px;
        font-family: 'Times New Roman',Times,serif;
        font-size:14px;
}

a:hover {
	color:blue;
	font-weight:bold;
	background-color:#999966;
}

.auto-style1 {
	text-decoration: none;
}

#suggestionDiv{
    width: 25%;
    visibility: hidden;
    height: 150px;
    z-index: 2;
}
2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by shaya4207
0

First of all, in your code snippet on line 2 you're missing a closing 'font' tag </font> .

Second if I understood your problem correctly, the reason why this is happening is because a <div> is a 'block' element, which means that it will display as it's own line, as if as it were a 'block' pushing everything else away, try giving the <div> a style of display: inline; that should make it stay inline, and not push everything around...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.