How to make an inline-block element fill the remainder of the line?

See: http://jsfiddle.net/qx32C/36/ .lineContainer { overflow: hidden; /* clear the float */ border: 1px solid #000 } .lineContainer div { height: 20px } .left { width: 100px; float: left; border-right: 1px solid #000 } .right { overflow: hidden; background: #ccc } <div class=”lineContainer”> <div class=”left”>left</div> <div class=”right”>right</div> </div> Why did I replace margin-left: 100px with overflow: … Read more

How can I select the element prior to a last child?

You can use :nth-last-child(); in fact, besides :nth-last-of-type() I don’t know what else you could use. I’m not sure what you mean by “dynamic”, but if you mean whether the style applies to the new second last child when more children are added to the list, yes it will. Interactive fiddle. ul li:nth-last-child(2)

My position: sticky element isn’t sticky when using flexbox

Since flex box elements default to stretch, all the elements are the same height, which can’t be scrolled against. Adding align-self: flex-start to the sticky element set the height to auto, which allowed scrolling, and fixed it. Currently this is supported in all major browsers, but Safari is still behind a -webkit- prefix, and other … Read more

Apply style ONLY on IE

@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { #myElement { /* Enter your style code */ } } Explanation: It is a Microsoft-specific media query. Using -ms-high-contrast property specific to Microsoft IE, it will only be parsed in Internet Explorer 10 or greater. I have used both the valid values of the media query, so … Read more

Gray out image with CSS?

Does it have to be gray? You could just set the opacity of the image lower (to dull it). Alternatively, you could create a <div> overlay and set that to be gray (change the alpha to get the effect). html: <div id=”wrapper”> <img id=”myImage” src=”https://stackoverflow.com/questions/286275/something.jpg” /> </div> css: #myImage { opacity: 0.4; filter: alpha(opacity=40); /* … Read more

What’s so bad about in-line CSS?

Having to change 100 lines of code when you want to make the site look different. That may not apply in your example, but if you’re using inline css for things like <div style =”font-size:larger; text-align:center; font-weight:bold”> on each page to denote a page header, it would be a lot easier to maintain as <div … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)