Jump to content

CSS Issue


adam84

Recommended Posts

Ok, I am trying get out of the habit of tables and using div tags. But I haven't had a whole lot of luck.

 

The page I am working on is a register page.

 

I have my main div tag called 'mainContent' where all my site information gets loaded into.

Inside that div, I have another div tag called 'subContainer', which I refer it to be like a <tr>

Inside that div, I have two more div tags, 'fieldTitle', which formats the field title ('user name', 'password', 'email', etc)

The next tag is 'fieldElement', which just holds the textfield, select, etc.

 

What I want to do is have the fieldTitle div span 50% of the row( 'subContainer' ), then have the 'fieldElement' span the remaining 50%.

But for some reason, it is not doing that.

 

 

HTML

<div class="mainContent">
<div class="subContainer">
	<div class="fieldTitle">
		User Name:
	</div>

	<div class="fieldElement">
		<input class="textField_Effects" type="textfield" name="userName" id="userName" maxlength="25" size="25">
	</div>
</div>
</div>

 

CSS

.mainContent{
border: 1px solid #000000;	
margin-left: 15%;
width: 100%;
height: 100%;
}

.fieldTitle{
width: 50%;
border: 1px solid #000000;	
font-weight: bold;
font-size: 12px;
text-align: right;
display: inline;
}

.subContainer{
width: 100%;
margin: 0; 
border: 1px solid #000000;
}

.fieldElement{
border: 1px solid #000000;	
width: 50%;
text-align: left;
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.