beakofthoth Posted August 31, 2009 Share Posted August 31, 2009 I am trying to have form elements display as table elements, so that semantics is not violated by the use of tables. I have a generic login form that looks like this:<form><div><label for="uname">User Name</legend><input id="uname" type="text"></div><div><label for="pass">Password</label><input id="pass" type="password"></div></form>My CSS looks like this:form {display: table;}form div {display: table-row;}legend {display: table-cell;}input {display: table-cell;}What am I doing wrong? Link to comment Share on other sites More sharing options...
jeffman Posted August 31, 2009 Share Posted August 31, 2009 IE throws a fit when you try to use display modes of any table variety. If it's neatness you're after, use float, width, margins, and padding on your divs. Especially float and width. That's how you'll get them to line up like cells. Use clear when you want to start a new "row." Link to comment Share on other sites More sharing options...
beakofthoth Posted August 31, 2009 Author Share Posted August 31, 2009 IE throws a fit when you try to use display modes of any table variety. If it's neatness you're after, use float, width, margins, and padding on your divs. Especially float and width. That's how you'll get them to line up like cells. Use clear when you want to start a new "row."I'm using Firefox as my main test browser, and it doesn't work there either. I *expect* new techniques not to work in IE Link to comment Share on other sites More sharing options...
beakofthoth Posted August 31, 2009 Author Share Posted August 31, 2009 Oops, I figured out what I did wrong and it was a completely stupid mistake.I tried to close the first LABEL tag with /LEGEND, which obviously isn't going to work Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.