How to reference another selector in css
Tags: css,twitter-bootstrap-3
Problem :
I'm using bootstrap in a new project of mine and when I create a table I need to type this code <table class="table table-responsive table-striped table-bordered table-hover">
I would like to just use <table class="table">
and add the rest automatically.
I was hoping this could be done with css like the following:
.table {
add .table-responsive;
add .table-striped;
etc...
}
Is something like that possible, if not, what should you do to solve this?
Solution :
it is not possible in pure css. if you use some css templater language like Sass, you could use @extend for this purpose. however in fact it will just produce css with .table class and copy-pasted css rules of another classes.
--
with @torazaburo remark. actually it will produce
.another-class, .table { another-class-rules }
rather than
.table { another-class-rules }
CSS Howto..
You need li action so you need to use Either Jquery or Javascript. Use following JavaScript will solve your issue. HTML: <div id="colOne"> <h3>Fruit</h3> <div class="bg1"> <ul> <li class="litest"><a href=""...
Gice the divs a width / class that has a width, in which only three can fit on (i.e 30% width). That way your browser will only alow 3 on...
The secret is to use some sort of framework/methodology that enforces discipline e.g. OOCSS or BEM.
You can do something like this. 0% { -webkit-transform:rotate(0deg) } 20% { -webkit-transform:rotate(360deg) } 100% { -webkit-transform:rotate(360deg) } and change the duration of the rotation -webkit-animation-duration: 6s; So what you...
Just check this: http://jsfiddle.net/SQ9Hf/2/ You need to put some float, and the best thing to do is to put each div with a % width....
You could try using different classes for each image, and then just swap out CSS classes in a given interval. $(document).ready(function(){ var seconds = 5000; var step = 0; var...
Generally the text element cannot have a background. To do that you should use renderer and add extra shape (rect). Styles should also be applied in css() attr() function instead...
Besides the xpath locator //select[@style='background-color:#FFD5D5'], you can try verifyAttribute or maybe JavaScript window.getComputedStyle(*element*,null).getPropertyValue('backgroundColor');....
Update your #navigation_bar with #navigation_bar { display: flex; align-items: center; justify-content: center; padding: 0; } Here is the working Demo #navigation_bar { list-style-type: none; margin: 0; position: fixed; background-color: #333;...
Twitter's bootstrap .span classes are floated to the left so they won't center by usual means. So, if you want it to center your span simply add float:none to your...
If you don't want the background size to shrink when the user resizes, add the min-width property to background. You could go with CSS media queries for altering your...
You have both access to the dragged objects id and the targets id. Which you can use for your validation. Here is an example which would allow the first 4...
Defining the helper in Template.tblScheduler.helpers doesn't work, as you call it from the body template: Either create a global template like this: Template.registerHelper('isChiefTemplate', function(){ return Session.get('curTemplate') === 'tblScheduler'; }) or...
<p class="call">To book a consultation click here or call <span class='bigger'>NOW</span></p> with CSS .bigger { font-size:200%; } ...
If you want a pure CSS solution I suggest looking into the Target psuedo element, otherwise - Here is a pure javascript solution. Just give the divs you are hiding...
You are complicating your CSS a lot for what you want, you can use CSS Flexbox along with CSS calc() for this body { margin: 0 } section { background:...
Unfortunately, with CSS only, you're not able to do it. You need to use JS. I am giving you a jQuery example - $(document).ready(function(){ $('input').addClass('disableHotkeys'); }); or $(document).ready(function(){ $('input').each(function(){ $(this).addClass('disableHotkeys');...
Just use this css: td { white-space: nowrap; overflow: hidden; text-overflow:ellipsis; } And the result is like this: http://jsfiddle.net/ongisnade/pghny/...
You can do it with plain CSS: <!DOCTYPE html> <html> <head> <style> div { border-radius: 4px; width: 100px; height: 20px; background: green; position: absolute; top: 50px; left: 50px; text-align: center;...
If your images are the same size, you could use pseudo elements with borders. this will mean that you need to make the border width + height to be the...
<div style="color:#ffffff;">Your text next to your form. </div> ...
You're close- if I just add the hColor class, which has all of the transition properties, to the elements you're adding/removing classes from, it works: http://fiddle.jshell.net/whvSL/9/ Hover over the top...
just like this: changeWidth($("#testbar"), '50%'); it does work for me....
https://github.com/paulirish/matchMedia.js/ is a good option for making media queries in javascript....
Inline elements can be easily centered by using the css property "text-align:center;". Block elements should be align in the center by using "margin-left:auto;margin-right:auto;" and by giving them a fixed width....
The horizontal line is the bottom-border from the .popover-title See if this works for you: .popover-title { border-bottom: none; } Alternatively, if you want the line to be a specific...
I suggest to replace current #footer ul.navigation rule with this one #footer ul.navigation { float: right; display: block; line-height: 24px; list-style: none; margin: 0; padding: 0 10px 0 0; }...
One problem with the accepted answer is that the browser will have to load the content of all the tabs on page load. This may not be very good if...
There is no need add !important until you are going to override already existing css line. So the code would be like this, #content img { max-width: 100%; height: auto...
Instead you can override some properties of default clases of bootstrap with .init class and use bootstrap alert message like this: .init { border:2px solid #EEEEEE; font:14px/1.3 Verdana,"Lucida Grande",Arial,Helvetica,Sans-Serif; margin:0px;...