How to stretch the form submit button using CSS?
Tags: html,css,button,padding,stretch
Problem :
how do I stretch a form submit button using CSS? I'd like to have some kind of horizontal padding between the text inside the button and the button left and right end. Is this possible, and if so, how?
Tips for making the button prettier (without using images) are also much appreciated :-).
Solution :
Increase the width
of the button.
<input type="submit" class="btn" />
CSS:
.btn{
width:250px; /* adjust value */
}
CSS Howto..
submit_tag generates the text as the value attribute of the input tag. submit_tag "Edit this article" # => <input name="commit" type="submit" value="Edit this article" /> So adding strong to that...
Hey StormShadow. To edit the style of Sencha components you shuld learn SASS, in fact, Sencha Touch, exactlly like the new Ext 4 framework, uses SASS and COMPASS to create...
Try doing this... document.getElementById("MyElement").className += " MyClass"; Got this here... ...
Short answer: you can't. Long answer: you shouldn't. Give it a class name or an id and use stylesheets to apply the style. :hover is a pseudo-selector and, for CSS,...
You can use & to refer to the parent selector: li:first-child { border-right: solid 0.188em #da291c; padding: 0 2em 0 0; & + li { padding: 0 0 0 2em;...
http://jsfiddle.net/QxqL4/6/ The way I have handled this in the past is to wrap the image in a <span> and float that element. You should be able to add text after...
Dont hide it with display:none, set visibility:hidden display:none will take it out of the DOM flow. Changing the visibility to hidden will keep it there but emulate setting opacity to...
Ok, I solved it. I think that I just overdid it in my mind. Instead of writing styles.header.menu I could just write styles.menu, even if it was nested...
Is it possible to display epub format books in web browser using pure HTML5, CSS and jQuery? Yes, it is possible. Why do you want to write an epub...
For .container:after, change position: relative to position: absolute. Live, working example: .container { background: url("http://msue.anr.msu.edu/uploads/images/forest.jpg"); height: 400px; width: 100%; box-shadow: inset 0px -4px 14px 0px rgba(50, 50, 50, 0.71); background-size:...
You are applying your li styles to every li which is why you are having trouble. In order to apply styles to a specific item you can use a class...
I think you want this: http://jsfiddle.net/NicoO/jhgcm6ym/ HTML: <div id="bullets">Left</div> <div id="quotes">Right</div> CSS #bullets { width: 60%; float: left; } #quotes { margin-left: 60%; } display: inline-block; and float do not...
The best way to do this is just put you nab bar in a div wrapper and float it to left and then put your profile img and text to...
If you don’t want to use the resize property, there’s no other option to do this with CSS. However, you can achieve this with JavaScript. There are libraries that support...
My ul "reset" looks something like this: ul { list-style-type: none; margin: 0; padding: 0 } ...
This should be enough: Sys.WebForms.PageRequestManager.getInstance().add_endRequest(onEndRequest); function onEndRequest(sender, args) { if (sender._postBackSettings.panelsToUpdate != null) { $("select:not(.chosen-single, .no-chosen)").chosen({ search_contains: true, width: "200px", no_results_text: "Sorry, no match!" }); }...
You can use a pseudo element ::after to create an overlay. Just use opacity: 0; to hide it, and show it on hover: opacity: 0.6;. As transition you can use:...
Don't use the img tag. Use the a itself: a { display:inline-block; width: 250px; height: 188px; background: red; } a:hover { background: blue; } <a href="http://google.com"></a> ...
IMO you'd have to save the variable to your server and would need to write your style-sheet in a language that would be able to pull variables from your Server...
Lets say your HTML looks something like this: <div class="box"> <!-- stuff --> <p class="bet_time">Bet 5 days ago</p> </div> Then, with CSS, you can make that text appear in the...
Do you want it in the nav bar or as the body background? If you want it in the nav bar it would look something more like this: <style> nav...
You can use :pseudo elements use skew for the ribbons box-shadow for the inner circle .medal { width: 100px; height: 120px; } .ribbon { width: 80px; height: 70px; margin: 0...
According to the comments/request, here is the edited version of the original CSS code to reflect the desired result: /* apply to both */ .menu ul { padding-left: 0px; }...
#lefttop, #leftbottom {float:left;width:200px;} #leftbottom {clear:left;} #central {margin-left:200px;float:right;width: the-width-you-need px} Come to think of it, width:auto might be the best choice for #central *edit sorry for all the typos earlier...
Check sample for two background image in a single div tag. CSS: .container{ width:300px; height:150px; background:url(http://img.b8cdn.com/images/icons/loading_large_icon.gif) no-repeat 50% 28%, url(http://twitter-badges.s3.amazonaws.com/t_logo-a.png) no-repeat 50% 60%; border:1px solid #CCCCCC; } ...
For anything dynamic happening on the client side (like DOM Manipulation) you will want to use Javascript. I've written an example for you using a jQuery; but you're free to...
Since a js solution was suggested and pure CSS isn't presently possible: Live demo (click). Sample markup: <p class="bold-second-word">John Smith</p> <p class="bold-second-word">This guy and stuff.</p> JavaScript: var toBold = document.getElementsByClassName('bold-second-word');...
I fiddled with jsfiddle, and this worked: $('#photo').css('transform', 'rotate(90deg) scaleX(-1)'); To relate it to your question, the resulting CSS looks like transform: rotate(90deg) scaleX(-1); ...
Demo here. Here's what I did: First, the drop-down menu inside the draggable wasn't showing up at all. I put the dropdown menu ul inside the li that has the...
Most of your styling resides on the li, try moving them to the <a> tag instead li { float: left; margin: 0 .15em; } a, a:active, a:visited { border: 1px...