Showing posts with label css. Show all posts
Showing posts with label css. Show all posts

Thursday, 23 February 2012

CSS: How to select id/class that contain an attribute equal to foo1

Assume we have the following labels:
<label for="foo1"></label>
<label for="foo2"></label>
Then the following CSS selector will make bold the 1st one (with for="foo1"):

label[for="foo1"] {
  font-weight:bold;
}

Monday, 16 January 2012

Web page UTF-8 encoding problems/rules

Make browser render page as UTF-8

Use the following meta-tag:
<head>
 <!-- set response header: Content-Type: text/html; charset=UTF-8 -->
 <meta http-equiv="content-type" content="text/html;charset=utf-8">
 
 <!-- for HTML5 use the following:
 <meta charset="UTF-8">
 -->

</head>
Also save the html file with UTF-8 encoding.

Make browser render css as UTF-8

Use the following meta-tag:
/** Content-Type: text/css; charset=UTF-8  */
@charset "UTF-8"; 
Also save the css file with UTF-8 encoding.

Thursday, 24 November 2011

JSF: include in css an image

In recourses/:

  • foo1/foo2/style.css
  • foo1/foo2/image.gif
background-image: url(#{resource['foo1:foo2/image.gif']}); 
which becomes:
background: url(javax.faces.resource/foo2/image.gif.xhtml?ln=foo1);  

References