PDA

View Full Version : TextAlignment Help



rfresh
Jan 17th, 2009, 08:08 PM
I have two divs that I am aligning horizontally via float. My problem is that the second div ID=type text "Type" sits higher than the first div's text "Delete" (I guess because its a checkbox element) - is there any CSS way I can lower the "Type" text to better vertically align it with "Delete"?

Thanks...



#delete {
color: Black ;
float: left;
padding: 2px;
width: 64px;
background-color: #99CCFF;
border-top: 1px solid #C0FFFF;
border-left: 1px solid #C0FFFF;
border-right: 1px solid #0000FF;
border-bottom: 1px solid #0000FF;
}
#type {
color: Black ;
float: left;
padding: 4px;
height: 16px;
width: 60px;
background-color: #99CCFF;
border-top: 1px solid #C0FFFF;
border-left: 1px solid #C0FFFF;
border-right: 1px solid #0000FF;
border-bottom: 1px solid #0000FF;
}




<div ID="delete"><INPUT TYPE="checkbox" NAME="chk_type">Delete</div>
<div ID="type">Type</div>

Excavator
Jan 18th, 2009, 11:01 AM
Hello rfresh,
Does this help?

<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
html, body {
font: 12px "Comic Sans MS";
color: #000;
background: #FC6;
text-align: center;
}
* {
margin: 0;
padding: 0;
border: none;
}
#wrap {
width: 800px;
margin: 30px auto;
background: #999;
overflow: auto;
}
#delete {
float: left;
padding: 4px;
height: 16px;
width: 64px;
background: #99CCFF;
border: 1px solid #C0FFFF;
}
#type {
float: left;
padding: 4px;
height: 16px;
width: 60px;
background: #99CCFF;
border: 1px solid #C0FFFF;
}
</style>
</head>
<body>
<div id="wrap">
<div id="delete"><input type="checkbox" name="chk_type" />Delete</div>
<div id="type">Type</div>
<!--end wrap--></div>
</body>
</html>

rfresh
Jan 18th, 2009, 05:33 PM
That worked - thank you...