Apply a CSS class to a button [closed] - css

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am very new to CSS, and was wondering how to apply a class to a button.
For example, suppose I had this class:
.myclass
{
background-color: #ff0000;
}
How would I properly apply that to a button?
I am really new to CSS, and appreciate your help!

Simply set the button's class attribute to your CSS class:
<button class="myclass">Button text</button>

If you use <button>, you can do <button class="myclass">Hello world</button>
If you use <input />, then it is
<input name="hello" type="submit" value="Hello world" class="myclass" />

Related

Add a font icon in php [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
Trying to add a fa font icon after the Explore text. Not sure what syntax I need to use.
echo ' <a class="quick-view" data-prod="'.$product->get_id().'"href="#quick-view">'.__('Explore','flatsome').'</a>';
Simply put the <i></i> after your text
echo '<a class="quick-view" data-prod="'.$product->get_id().'"href="#quick-view">'.__('Explore','flatsome').' <i class="fa fa-eye"></i></a>';
Try below code:
echo ' <a class="quick-view fa fa-eye" data-prod="'.$product->get_id().'"href="#quick-view">'.__('Explore','flatsome').'</a>';

Redefining previously defined class in CSS with tag [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
Can anyone explain the following CSS code?
.main aside {
background: linear-gradient(white, pink);
}
where main is a CSS class.
That rule applies to each aside tag (not class) which is inside an element that has class main
example:
<body>
<div class="main">
<div>
<aside>
... (rule applies here)
</aside>
</div>
</div>
</body>

How to DELETE "overflow-x" compeletly [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Instead of hiding the overflow-x What can we do for deleting compeletly this ?
Because the page can be scrolled again but it's just get hidden.
I want to DELETE this .
What to do ?
you can use in your css code overflow:hidden;
you can also set the x value by scrollLeft in css.
for example
<div style="overflow:hidden;height:50px;" onscroll="return false;">
asdsad<br />
asdsad<br />
asdsad<br />
sadsad<br />
asdsad<br />
</div>
other way just set a "div" box that enclose your tag and give height and width to it..

making classes respond in bootstrap [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Am currently designing a website using bootstrap and so far I have come up with a very nice website that is supposed to respond but it doesn't when scaled down. I want the website to respond to the following screen sizes: 768x1024, 800x1280, 980x1280,1280x600 and yet I've read bootstraps docs of responsivenness and tried them but nothing has changed.
I created my own classes inside a getbootsrap template and even when I tried to put them inside;
<div class="col-md-4"><div class="andy-redbackground"</div>
</div>
even tried to get into the classes and insert:
background-size:cover;
but nothing worked out.
Try this code:-
<div class="row">
<div class="col-xs-4">
<div class="andy-redbackground"></div>
</div>
</div>

css3 attribute selector based off of class [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I'd like to style a text box within a div that has a specified class:
<style>
.myStyle input[type="text"] {
width: 250px;
}
</style>
<div class="myStyle">
<input type="text">
</div>
This code doesn't work, is there a way to do this? (other than assigning a class to the text box itself).
There's nothing wrong with your CSS, just add </input> before the </div> and you'll be good to go.
Fiddle: http://jsfiddle.net/6zmNM/ (With JS to provide an alert for the width of the text box)

Resources