CSS how to change color of a specific primary-panel in a if-block
Tags: css
Problem :
I have many panels and want to change the color of a primary-panel after the counter is 10;
this.dateUpdate = function (element) {
if (hasfocus == element) {
dateCounter += 1;
if (dateCounter == 10) {
element.addClass('changecolor');
dateCounter = 0;
}
}
};
This is not working:
.changecolor > .panel-primary {
background-color: #e1e1e1 !important;
}
to remember, I just want to change the specific one, and not all.
Thx in advance.
Solution :
If the panel-primary
div is inside changecolor
div
.changecolor .panel-primary {
background-color: #e1e1e1 !important;
}
If the panel-primary
div is the same div in which changecolor
class is getting applied
.changecolor.panel-primary {
background-color: #e1e1e1 !important;
}
CSS Howto..
You wouldn't want to try accomplishing this through styles alone. What you want is a script to help you with syntax highlighting, such as highlight.js, perhaps (https://highlightjs.org/) From the usage...
You should add rgba to your color background html,body { background:rgba(255,165,0,0.5); } ...
With the current structure (which you indicate is required) a pseudo-element positioned over the main div would do the trick. Note: I am only solving the overlay issue. You would...
With Jetty 9, the process is super simple. In your {jetty.base}/webapps/ directory create a sub-folder that will house your static file content and put your HTML/CSS in there. Note that...
You have to put the loop before col-md-4 class. Otherwise the div will not repeat. You cant get your images horizontally.Try below code and it will fine for you. <div...
Use something like this; <script> $(document).ready(function(){ //Code goes in here. }); </script> Don't forget to load the jQuery library at the same time from http://jquery.com/ Also, you are going to...
As stated in the comments, OSX hides scrollbars by default. There are a few CSS options which explicitly work for osX/Chrome in order to handle ScrollBar behaviour/appearance: .frame::-webkit-scrollbar { -webkit-appearance:...
Looks like you can't actually do this at the moment... however the CSS parser does support Infinity... Sounds like they're be pretty open to adding support for it if you...
You can use querySelector and then use css like selectors. It returns the first element of all selected elements. If you want to return all you can use querySelectorAll document.querySelector(".exp-1,.exp-2,.exp-3,.exp-4");...
try this using jquery : https://jsfiddle.net/xqyhwq36/3/ li a:hover:not(.active) { background-color: #111!important; } li a:hover { background-color: #444; } .active { background-color: #4CAF50; } $("ul a").click(function(){ $("ul a").removeClass("active"); $(this).addClass("active"); }); ...
text-align will not affect floated elements. However it will affect inline elements. Change: li { float: left; } To: li { display: inline-block; } JSFiddle demo. Thank you, but there...
The reason that the width's are not accurate is because they are set to box-sizing:content-box;, which is the default setting for box-sizing. When the width and height are calculated in...
To disable the re-sizable feature of the text area, use textarea {resize:none} /* completely disable resize */ textarea {resize:vertical} /* disable horizontal resize */ textarea {resize:horizontal} /* disable vertical resize...
EDITED: put the links in an unordered list (ul) and assign display: inline-block to the li elements. Wrap the ul in a div to which you assign text-align: center;: <div...
NEW answer: I guess you just want a wider form on the small screens. Your site is adjusted in a wrapper, so the width:80% is small on a small screen....
Using flex-flow: Just add into yours .dashboard-top-item this CSS property with value: flex-flow: column; Result: JSFiddle. Using flex-wrap and min-width: This one is a little bit more complex. .dashboard-top-item {...
it's simple only you have do is to give background: rgba(0,0,0,0.5) & for IE use this filter {background: transparent;-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#7F000000,endColorstr=#7F000000)"; /* IE8 */ filter:...
It opens all your "Read more"s, because in JS you select all $('.continue-article') elements. You have to select only preceding one. $('.read-toggle').click(function() { if($(this).prev('.continue-article').hasClass('show')) { $(this).prev('.continue-article').removeClass('show'); $(this).children('span').text('Read More');...
Inline element like <span> wraps around the content and more. Either you can use this or you can set the display property as inline. div { display: inline; } However...
You need to include CSS on your page, either by embedding it in the <head> or by linking to an external stylesheet. <!DOCTYPE html> <html> <head> <!-- external CSS -->...
Figured it out, requires flex-flow: column wrap with display: flex and align-content: left #deck { flex-flow:column wrap; display:flex; align-content:left; height:204px; width:250px; overflow:auto; background-color:grey; } .card { background-color:white; margin:1px; width:100px; height:100px;...
You could go for a jquery package: http://www.malsup.com/jquery/block/ With this you can render content unselectable while loading, and add the loading image ontop of it. This is supported by the...
It's messy, but throwing in some CSS animations did the job. http://jsfiddle.net/Pd426/1/ The new CSS: #box{ -moz-border-radius:15px; border-radius:15px; width:1px; height:1px; background:#D8D8D8; border:2px solid black; position: relative; margin-left:100px; margin-top:150px; transform:rotate(0deg); -ms-transform:rotate(0deg);...
Using :hover on .box did the work for me: .box:hover{ border-color: white } You've to note the order (the following example will not work): .box { border-color: black } .box:hover{...
The 'Global Scripts' your teacher is referring to are individual, external files. This is good practice as inline code can bloat a page's size, whereas an external file can be...
You can use the php include method: http://php.net/manual/en/function.include.php in order to not have to repeat parts of your page that are always needed. For example, the header and footer, navigation,...
I have created a jFiddle for you here: http://jsfiddle.net/persianturtle/RfURY/ The answer is actually quite simple. I just added a class: .current li { height:50px; } This controls the height of...
Your problem is to center image in div which size you don't know. Change #back image position to relative thus it will stretch parent div. Set position of two other...
Whichever element you want centered - set an explicit width and then set left/right margins to auto #main { width:995px; margin:0 auto; } ...this will center the element in its...
If you don't require support for IE8, you can use pseudo-state :empty (here for more examples ) to reset padding for all instances of .myClassDie without content, using the following...