I want my button at the top within the DIV
Posted: Fri, 2008-05-16 15:17
I am trying to position a button at the top within the DIV that contains it but it stubbornly remains in the middle where it wants to be. After playing around a bit here's what I have. Any clues?
.butt1{
Height:47px;
width:100px;
background : grey;
top: 1px; }
form div.g{
width: 280px;
float: right;
vertical-align:top;
padding: 42px;
height: 18px;
margin: 15px 4px 0;
background-color : orange;
}


Regular
Posts: 14
Joined: 2008-05-06
Whoops, html:
Posted: Fri, 2008-05-16 15:22
Whoops, html:
<asp:Button ID="Button1" runat="server" class="butt1" OnClientClick="return ValidateBOX();"Style="z-index: 116;" Text="View" />
Enthusiast
Posts: 201
Joined: 2008-03-16
Unfortunately you haven't
Posted: Fri, 2008-05-16 20:16
Unfortunately you haven't posted the required information, even though this is not the first time your posting. Please make sure you have the complete CSS and html including a doctype. So, just a guess here: Your padding in the div is set to 42px from top, bottom, right and left. Might that cause the problem?
Regular
Posts: 14
Joined: 2008-05-06
padding
Posted: Mon, 2008-05-19 13:25
Yes, after experimenting, I removed the padding and it worked.
Regular
Posts: 14
Joined: 2008-05-06
posit
Posted: Mon, 2008-05-19 15:31
Here's a little puzzler for me.
I have 2 labels in a div, one floated right and other left. How would I move the left one over to the right a bit in a desired position?
Enthusiast
Posts: 201
Joined: 2008-03-16
with margin-left?
Posted: Wed, 2008-05-21 08:03
with margin-left?
Regular
Posts: 14
Joined: 2008-05-06
The best easiest way
Posted: Wed, 2008-05-21 14:23
The best easiest way possible, I guess. I could put another div within that div and position the that div so that the label goes along for the ride?
Enthusiast
Posts: 201
Joined: 2008-03-16
Why would you want to do
Posted: Wed, 2008-05-21 15:59
Why would you want to do that? It increases your file size, is not semantic and does not give you any extra advantage.
Please, in the future create an extra thread for each question that you have, not forgetting to mention that posting the full code is essential.
Regular
Posts: 14
Joined: 2008-05-06
THREAD
Posted: Wed, 2008-05-21 18:37
I guess I could've started a new thread but since I've already commenced this I'll clarify my point. I just made a suggestion but did say that I'm looking for the best way to solve my quest. Obviously my suggestion is innefficient & creates a larger file. But to put it simply, I just wanted to know how to shift the left label("Purchase Queries") to the right a bit. I'm new here and new to css & html
<div class="pre-head">
<asp:Label ID="Label12" runat="server" cssclass="second-txt" Style="z-index: 118;" text="Purchase Queries" ></asp:Label>
<asp:Label ID="Label13" cssclass="first-txt" runat="server" Style="z-index: 118; "Text="data update"> </asp:Label>
</div>
.first-txt
{float:right;
height:222;
font-size:medium;
color : red;
width:259px;}
.second-txt
{float:left;
height:222;
font-size:medium;
color : red;
width:123px;
}
form div.pre-head{
width: 692px;
float: left;
padding: 2px;
height: 28px;
margin: 15px 4px 0;
font-size:small;
background-color : white;
}
Enthusiast
Posts: 201
Joined: 2008-03-16
ok, it would had made sense
Posted: Wed, 2008-05-21 21:57
ok,
it would had made sense to start a new thread, since it is a totally different issue.
Looking at your CSS I can say that you did a lot of thinking, but this is not the right way to go about it. But don't worry, I can say from my own experience that forms are the most hated and least documented element.
There are elements to create a form, makes it easier, semantic and more accessible. One element would be the form element that replaces your form div.pre-head, and the label element replaces your txt classes.
We currently had a very interesting thread about it. Maybe you read up on it here, do some googling, and come back for any further issue.