Tag Archives: css

Archive

Center aligning a table within DIV element

Define the CSS style in css file or header of the HTML page: Continue reading

Setting Style/CSS of select options using jQuery

This is how i set style (color here) of all of the options of a select list using jQuery.

In my case i had select options like this:

<select id=”select_list_id”>
<option value=”#595959″>Grey</option>
<option value=”#000000″>Black</option>
<option value=”#036″>Blue</option>
<option value=”#363″>Green</option>
<option value=”#632423″>Red</option>
<option value=”#403152″>Purple</option>
<option value=”#E36C0A”>Orange</option>
</select>

Follwoing the jQuery code i used to set color of options above:

  $(document).ready(function(){
	$('#select_list_id option', this).each(	
		function ()	{
			$(this).css({'color':$(this).val()});
		}
	)
  });

When Firebug made life easier

It’s been around three years now i have been using the Firebug. This great tool provides a web developer an easy way to look at and inspect the source code of a web page. You can view and experiment with each and every part of your web page and related DOM elements, inline or linked CSS, JavaScript and not to say the entire page content. Continue reading

CSS and rounded corner example

This is the very first CSS rounded corner technique i learned and used. If someone interested can use it without any doubt. Although, it may look like having too many ‘div’ layers in it, it is a good one, not to say works in all browsers well. Continue reading