Hiding the scroll bar on an HTML page

WebKit supports scrollbar pseudo elements that can be hidden with standard CSS rules: #element::-webkit-scrollbar { display: none; } If you want all scrollbars hidden, use ::-webkit-scrollbar { display: none; } I’m not sure about restoring – this did work, but there might be a right way to do it: ::-webkit-scrollbar { display: block; } You … Read more

How to apply !important using .css()?

The problem is caused by jQuery not understanding the !important attribute, and as such fails to apply the rule. You might be able to work around that problem, and apply the rule by referring to it, via addClass(): .importantRule { width: 100px !important; } $(‘#elem’).addClass(‘importantRule’); Or by using attr(): $(‘#elem’).attr(‘style’, ‘width: 100px !important’); The latter … Read more

CSS Background Opacity [duplicate]

Children inherit opacity. It’d be weird and inconvenient if they didn’t. You can use a translucent PNG file for your background image, or use an RGBa (a for alpha) color for your background color. Example, 50% faded black background: <div style=”background-color:rgba(0, 0, 0, 0.5);”> <div> Text added. </div> </div>

Limit text length to n lines using CSS

There’s a way to do it using unofficial line-clamp syntax, and starting with Firefox 68 it works in all major browsers. body { margin: 20px; } .text { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; /* number of lines to show */ line-clamp: 2; -webkit-box-orient: vertical; } <div class=”text”> Lorem ipsum dolor sit amet, … Read more

Why em instead of px?

It is wrong to say that one is a better choice than the other (or both wouldn’t have been given their own purpose in the spec). It may even be worth noting that Stack Overflow makes extensive use of px units. It is not the poor choice that the question suggests it is. Definition of … Read more

Can I write a CSS selector selecting elements NOT having a certain class or attribute?

Typically you add a class selector to the :not() pseudo-class like so: :not(.printable) { /* Styles */ } :not([attribute]) { /* Styles */ } But if you need better browser support (IE8 and older don’t support :not()), you’re probably better off creating style rules for elements that do have the “printable” class. If even that … Read more

Space between two rows in a table?

You need to use padding on your td elements. Something like this should do the trick. You can, of course, get the same result using a top padding instead of a bottom padding. In the CSS code below, the greater-than sign means that the padding is only applied to td elements that are direct children … Read more

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