How to select two elements with “> span” in CSS?
Tags: html,css,css-selectors
Problem :
In my html code, I have the following two div elements:
<div id="graph-sliders">
...
</div>
<div id="image-sliders">
...
</div>
And in my corresponding css code, I have the follwing (working) code to style "graph-sliders":
#graph-sliders > span {
...
}
However, what I am trying to do is have that css block style both graph-sliders
and image-sliders
. I have tried writing #graph-slider #image-sliders > span {
but it messes up the formatting when I view the webpage.
What is the correct way to style both image-sliders
and graph-sliders
with the > span
?
Solution :
Try the following:
#graph-sliders > span, #image-sliders > span {
...
}
CSS Howto..
I was able to roll out a solution based on a few answers on this site and the hint provided by @WesleyMurch. Essentially, I had to calculate the height and...
Simply add white-space:nowrap #carousel { width: 100%; height: 150px; background-color: #ff0000; overflow: visible; white-space:nowrap; } #carousel .slide { display: inline-block; } <div id="carousel"> <div class="slide"> <img src="http://placehold.it/300x150"/> </div> <div class="slide">...
write like this css: .sketch_img_thumb_box{ opacity: 0.1; } .sketch_img_thumb_box:hover{ opacity: 1; } html: <div class="sketch_img_thumb_box"> <div class="title"></div> <div class="artist"></div> <div class="rating_bar"></div> </div> because if you give opacity the parent then...
In Chrome, your styles will inherit from any parent styles - either in the same style sheet or, if you have any, in other attached style sheets. When a style...
Here is one way of doing it. Use position: relative to shift the #child element down by 20px; On the #parent element, add margin-top: -20px to get the content's top...
This might work better, not sure if its feasible for you. .storebtns { float:left; width:100px; } <a class="storebtns" href="http://www.google.com"> <img src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcSUZXG8Fd-auKjn_fLKsFtHMIarXLlcnDoTAvV86PSxmJFLwYgzJQ" width="100"/> </a> <a...
I have decided that building a separate stylesheet and then using the comment IF statement is the best solution. Keeps the stylesheets clean and it is more obvious to others...
Using a span was the correct choice but you should set it to inline or inline-block (or leave it alone altogether). As you found out, setting it to block made...
index.js: require.context('./blocks', true, /\.js$/); require.context('./blocks', true, /\.scss$/); ...
This should do the trick if there is only one occurence of the class bucket__main: document.querySelector(".bucket__main").style.overflow='hidden'; ...
Use margin-top with a positive and a negative value. .preamble { border: 1px solid black; margin-top: 20px } .preamble h3 { margin: -20px 0px; } http://jsfiddle.net/3ez4qh3m/ As for a specific...
Add overflow:auto to ul.ItemList li.Item ul.ItemList li.Item { padding: 15px; border-top: #ddd 1px solid; overflow:auto } DEMO...
ADD line-height: 41px; to button, label Demo CSS: button, label{ position: relative; cursor: pointer; padding: 0; margin: 0; background: transparent; color: inherit; font-size: 16px; border: none; outline: none; width: 41px;...
Chrome Developer Tools is great for toggling CSS styles, or even adding styles, all while viewing the changes live on your page. To use, open your page in Chrome, right-click...
http://jsfiddle.net/kvDr3/7 .post { white-space: nowrap; } .number { float: left; } .title, .info { white-space: normal; margin-right: 60px; } You probably also want to put a min-width or overflow-hidden on...
Try something like this .tester{ animation-name: highlight; animation-duration: 5s; animation-fill-mode: forwards; animation-timing-function: ease-in; background-color: green; } @keyframes highlight{ from {background-color: green;} to {background: lightgreen;} } @-webkit-keyframes highlight{ from {background-color: green;}...
So this is REALLY ugly, but it works (kind of). I'm basically creating a duplicate of parent as a sibling of child. parent-overwrite is hidden by default, then displayed on...
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...
Take a look on Expiration Headers. With this approach your client (browser) will load JS/CSS files only for the first time and then it will keep them in cache Example...
You should be able to confirm a text requires scrolling if you use "scrollWidth > clientWidth " of the container - assuming it has overflow:hidden and you take margin, padding...
floating the container and removing float:left from the .chat-window should produce the desired result. The <div class="chat-window"> default display is block so it automatically creates a line break therefore the...
Set the cache for static files either in web.config or via UI in IIS, for the static file folder you want to cache, add this in the config file and...
Use this jQuery code: $(document).ready(function(){ setInterval( function(){ var rotateVal = getRotationDegrees( $("#sun") ); var percentRotate = rotateVal / 360 * 10; $("#demo").text( percentRotate.toFixed(2) ); }, 250 ) });//document ready function...
Supposing you are using bootstrap, just set margin-bottom: 0 for the .navbar. You might want to remove borders as well. See fiddle: https://jsfiddle.net/yyw99nky/...
DEMO: http://jsbin.com/yowis/2/edit <div class="panel-heading clearfix"> This will clear the float issue. That's what the issue is. If you want both the text and the image: <div class="panel-heading clearfix"> and...
EDIT: Try removing position absolute from .path-fix And see if that gets you any closer. .path-fix { width:15px; } ...
Use .wrap, wraps an HTML structure around each element in the set of matched elements $('.old-style').wrap('<div class="responsive-table"></div>').removeClass().addClass('table table-bordered table-condensed'); .responsive-table { color: red; } .table { font-weight: bold; }...
Put the image in a separate div, all inside the header, like so: <div id="header"> <div id="banner"></div><!-- --><div id="menubar"></div> </div> Then use display: inline-block; on #banner and #menubar. Note the...
you may use hover and absolute to allow also tab crawling from a link to another : td,th { border:1px solid; } table { margin:1em; } tr> :last-child { width:1em;...
Just delet the previous build war file in webapps folder. then build the project once agin it will works correctly.