wildcard * in CSS for classes

What you need is called attribute selector. An example, using your html structure, is the following: div[class^=”tocolor-“], div[class*=” tocolor-“] { color:red } In the place of div you can add any element or remove it altogether, and in the place of class you can add any attribute of the specified element. [class^=”tocolor-“] — starts with … Read more

CSS force image resize and keep aspect ratio

img { display: block; max-width:230px; max-height:95px; width: auto; height: auto; } <p>This image is originally 400×400 pixels, but should get resized by the CSS:</p> <img width=”400″ height=”400″ src=”http://i.stack.imgur.com/aEEkn.png”> This will make image shrink if it’s too big for specified area (as downside, it will not enlarge image).

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

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

Is it possible to include one CSS file in another?

Yes: @import url(“base.css”); Note: The @import rule must precede all other rules (except @charset). Additional @import statements require additional server requests. As an alternative, concatenate all CSS into one file to avoid multiple HTTP requests. For example, copy the contents of base.css and special.css into base-special.css and reference only base-special.css.

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