Is it possible to add style for a selected element, for example:
I have bootstrap.css
and I have
<!DOCTYPE>
<html>
<head><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"></head>
<body>
<div id='a' class ='container'></div>
<div id='b' class ='container'></div>
</body>
</html>
Is it possible add bootstrap.css style only for #a element with jQuery or something else?
You can do it using SASS Inheritance.
Please refer below code :
'#a {
@import url(bootstrap.css);
}'
This will render you bootstrap css with "#a" prefix parent.
Thanks
Actually you can not do so. After all its a whole html document. Whichever css you include, It will apply to all elements of page.
One solution is for #b, You need to override the styles, If any that are applied by bootstrap.css
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With