Showing posts with label CSS. Show all posts
Wednesday, May 30, 2012
Insert an image in select control
select#colormenu option[value="Red"]
{
background-image:url(red.png) ;
background-repeat:no-repeat;
}
select#colormenu option[value="Green"]
{
background-image:url(red.png) ;
background-repeat:no-repeat;
}
select#colormenu option[value="Blue"]
{
background-image:url(red.png) ;
background-repeat:no-repeat;
}
select.icon-menu option
{
background-repeat:no-repeat;
background-position:bottom left;
padding:0px 0px 0px 20px;
}
<select id="colormenu" class="icon-menu">
<option value="none">Select color</option>
<option value="Red">Red</option>
<option value="Green">Green</option>
<option value="Blue">Blue</option>
</select>
But one issue with this code is it doesnt work on all browsers , but still it doesnt mess up the design..
Thursday, April 26, 2012
Friday, April 20, 2012
Flashing table row background
Can check this helps
http://jsfiddle.net/anuradha/w9UQn/
Friday, March 9, 2012
Remove vertical scrollbar in syntaxhighlighter
An annoying bug in the new version of SyntaxHighlighter 3 shows vertical scrollbar on every code snippet.
To fix this, change the code under syntaxhighlighter/syntaxhighlighter3/styles/shCore.css and replace overflow: auto !important; with the code below:
to:
To fix this, change the code under syntaxhighlighter/syntaxhighlighter3/styles/shCore.css and replace overflow: auto !important; with the code below:
.syntaxhighlighter
{...
overflow-x: auto !important;
overflow-y: hidden !important;
...
}
to:
.syntaxhighlighter {
...
overflow: hidden !important;
...
}
Wednesday, February 29, 2012
Create basic CSS menu with sub item
To create menu item we generally use ul-li tags
css_menu class is the one that is used mainly to create sub menu.
But mainmenu and submenu classes are just to apply styles for the menu items.
‘a’ class is applied to all tags. U can set class for anchor tag in menu and can apply the styles of this a tag.
Output:
<div id="css_menu">
<ul>
<li class="mainmenu"><a href="#">Link 1</a>
<ul>
<li class="submenu"><a href="#">Link 1-1</a> </li>
</ul>
</li>
</ul>
</div>
css_menu class is the one that is used mainly to create sub menu.
But mainmenu and submenu classes are just to apply styles for the menu items.
#css_menu li
{
list-style: none;
position: relative;
}
#css_menu ul ul
{
position: absolute;
top:0;
left:5px;
visibility:hidden;
}
#css_menu ul li:hover ul
{
visibility:visible;
}
.mainmenu
{
background-color:#EDC8FF;
width:60px;
padding:5px;
}
.submenu
{
background-color:#EDC8FF;
width:60px;
padding:5px;
left:30px;
}
a
{
font:italic bold 12px Georgia, serif;
color:Green;
}
‘a’ class is applied to all tags. U can set class for anchor tag in menu and can apply the styles of this a tag.
Output:
Subscribe to:
Posts
(
Atom
)