How to customize a set of controls with CSS
Tags: html,css
Problem :
I have this structure for fill out forms in html
<fieldset class="signup">
<div>
<label>First Name:</label>
<asp:TextBox ID="txtFirstName" runat="server"/>
</div>
<div>
<label>Last Name:</label>
<asp:TextBox ID="txtLastName" runat="server"/>
</div>
</fieldset>
And I defined this CSS
form fieldset
{
clear: both;
border-width: 0px;
border-style: none none none none;
padding: 0px;
margin: 0px;
}
form fieldset div
{
clear: left;
display: block;
margin: 10px 0px 10px 0px;
padding: 0px;
vertical-align: central;
}
form fieldset div label {
display: block;
float: left;
/*width: 150px;*/
padding: 1px 20px 0px 0px;
text-align: left;
vertical-align: central;
}
The appareance is clean but I commented the width attribute in the last style for labels in order to make it generic in the future. So I added a new style for my specific form and added this class to the fieldset but it's not working. I lost the width of my labels so how can I fix this mistake?
form fieldset div label .signup {
width: 150px;
}
Solution :
This should work:
fieldset.signup div label {
width: 150px;
}
CSS Howto..
The CSS Fonts Module Level 4 draft introduces new generic font families For most languages and scripts, existing generics can be mapped to something comparable to that script. That’s useful...
-webkit-appearance:none and add your own style...
I'm assuming you're talking about the horizontal distance between the steps not being of equal size. This is due to the text of the step, e.g. Uploading, being part of...
You need to clear the float. One method is: .training-border{ border-style: solid; border-bottom: thick dotted #ff0000; overflow: hidden; /* this */ } Demo...
David thanks!! - I just looked at the code you put on JS Fiddle and and couldn't figure it out but when I changed display to inline-block it worked. Seriously...
In case you are ok with a solution that also involve javascript you can use this: function updateImageHeight() { textHeight = $('.wrapper').height() - $('.wrapper img.img').height() imgMaxHeight = $('.container').height() - textHeight...
Remove the = between .touchbutton and the {. Also, based on how you have the positioning set up they're going to be stacked on top of one another (unless you're...
table#some_id {margin:10px;} Btw. you should never use * {margin:0;padding:0;}. Rather try a CSS reset...
Keep margin: 0 auto 0.55em; on figure > * and add display:block; I don't think margin: 0 auto works unless it's applied to block elements....
You can define form_class attribute on your update view and add css to that form. class ItemUpdateView(UpdateView): form_class = ItemForm ItemForm can be a ModelForm and you can customize it...
Any reason why you don't just make a PNG with the required shadow? Alternatively create a shadow image png and background a div with it that encompasses the ribbon. I...
You give it an absolute position eg td input { position:absolute; top:5px; } This will ensure it expands downwards. The top:5px; is how far from the top you want the...
You can always $("#tabs").removeClass("whatever") if you want, but you'll likely lose certain functionality if you do. The real question is why do you want to do this?
CSS cannot do this, to the best of my knowledge. My suggestion, then, is to use something like this: img, .fadeIn { /* styling */ } Now all images have...
row-eq-height class on the columns you want to be the same. More here: http://getbootstrap.com.vn/examples/equal-height-columns/ Just make sure you only need to support browsers that support Flex-Box....
You need to use border-bottom ... .element { border-bottom: 1px solid #555; } ... will be pretty close to the example in the linked image, where .element is the css...
Here's a simpler method: use Javascript to manipulate the CSS scale class: $(document).ready(function(){ var width = document.getElementById('hijo').offsetWidth; var height = document.getElementById('hijo').offsetHeight; var windowWidth = $(document).outerWidth(); var windowHeight = $(document).outerHeight(); var...
Floats, absolutely positioned elements, inline-blocks, table-cells, table-captions, and elements with 'overflow' other than 'visible' (except when that value has been propagated to the viewport) establish new block formatting contexts....
you can do this for the whole Liferay instance by specifying theme.css.fast.load=false in your portal-ext.properties file. However, if it's for verification pupose, you can just add css_fast_load=0 in your request...
It looks like your problem could be that 1.4.2 and 1.4.3 are not numbers and would be represented as string. You would need to add some logic like splitting the...
Change your style selectors as #outerTable > tbody > tr > td and #outerTable > tbody > tr.even > td See Fiddle Demo...
Add the runat="server" attribute to it so you have: <div id="formSpinner" runat="server"> <img src="images/spinner.gif"> <p>Saving...</p> </div> That way you can access the class attribute by using: formSpinner.Attributes["class"] = "classOfYourChoice"; It's...
It's because those elements are on top of the div with the shadow. In order to put them behind, you can use position: relative; on the background element and give...
There is a new property for backgrounds in CSS3 called "background-size" Try this: <html> <head> <title>Background-Image Test</title> <style> body { background-image: url(./3840x1200.jpg); background-size: 100%; background-origin: content; background-repeat: no-repeat; } </style>...
http://dotnetslackers.com/Ajax/re-70082_SliderExtender_layout_and_custom_appearance.aspx Custom Appearance In order to customize the slider’s appearance, we need to: Provide a CSS class for the rail Provide a CSS class for the handle Provide an image...
'a' tags inside of a styled tag (such as an 'li' tag) will not pick up any of the styles you set. They want their own styles. You will need...
You are calling the wrong variable in your second foreach. Also since you run the same code it would better to merge the two arrays and only use one loop....
You can't. With inline styles you are targeting the element directly. You can't use other selectors there. What you can do however is define different classes in your stylesheet that...
Problem is that you only define the function mouse, and only set the event handler, if img.length is > 0. The script is located in the head, and executed before...
This is not possible with CSS. I did some research and I found out that the same question was asked before here. The solution is to use this boxsizing.htc file...