how can style be added to the first 2 list elements using CSS
Tags: css
Problem :
I have a list of the following format, how can I add style to the first 2 list elements using CSS (should work in IE8):
<ul id="list1" style="margin-left:-20%;font-weight:bold" >
<li class="xyz"> Element1 </li>
<li class="xyz"> Element2 </li>
<li class="xyz"> Element3 </li>
</ul>
Solution :
Try this way
#list1 li:first-child
{
//styles//
}
#list1 li:first-child+li
{
//styles//
}
CSS Howto..
How do you explain this added space? I'm finding this to be somewhat unusual. As Alohci has explained in the comments, the display: table element masks the baseline of...
The Firefox pluging called "Web Developer" ( https://addons.mozilla.org/en-US/firefox/addon/web-developer/) has a "Display CSS By Media Type" option.
You could make use of CSS filter to add blur to top layer which is animated as below, filter - The filter property provides graphical effects like blurring, sharpening, or...
in your CSS, try changing position:absolute; with position:fixed;
If i understand your question well i suggest you to change padding:10px; to padding-top:10px; and increase width of <div class='login'> element EDIT Your image change almost everything , please check...
https://codex.wordpress.org/Function_Reference/wp_register_style, I guess it's a mediaquery, find out which stylesheet is for which device and remove/edit the $media option. It might be a lot easier to remove the $media option...
I just figured out.. If I set for : from background:url(../images/center_bg.jpg) to background:#fff url(../images/center_bg.jpg) => the selection color is like in chrome....
Just add padding to the #about_us box while slice its width and height accordingly: #about_us { padding:20px 40px; } and configure line-height for the p label: #about_us p { line-height:40px;...
Add the following property to .infobox: min-height: 100%; Or you can just remove the height properties entirely. But height: 100% will not work (at least in the fiddle) because it...
If you are looking to create a vertical variation of your design, please consider the below effect: .hovereffect, .hovereffect img { position: absolute; top: 0; left: 0; height: 100%; width:...
Here's an example of how to make it work always and everywhere. Right now it will stay dragging forever if you leave the element. It includes border checks and makes...
How to hide a whole a if table tag is is empty or null?
You could check if one of td's are empty or null in the ready function using each() method then hide the div using hide() : $(function(){ var hide = true;...
How about a non CSS - no javascript/jQuery answer? <select> <option value="" disabled selected>Select your option</option> <option value="hurr">Durr</option> </select> ...
Added css: #component>div{height:100%;} #component>div:first-of-type{border-radius:30px 0 0 30px;} #component>div:last-of-type{border-radius: 30px;} Edit in js: $('#component').children().not(':last').each(function () { What happens: The last div will not float left, and will just fill the space...
You have 2 options: add a transparent border on the non-focused input. This way the size won't change on focus, and you won't get the moving effect. work with outline...
No, it is not normally OK to use CSS for all your images. The image in this case is a piece of data, just like the title and description, and...
You should consider making two different pictures, one normal and one with the background you want. An other option would be a container div ( not a good idea for...
You could do something like this: by combining selectors table.class1, table.class1 td { border: 1px solid black; border-collapse: collapse; } <table class="class1"> <tr> <td>Jill</td> <td>Smith</td> <td>50</td> </tr> <tr> <td>Eve</td>...
Just add some styles to the 3 elements: #container{ height: 80px; width: 100%; display: table; } #one{ width: 20%; font-size: 90px; } #two{ width: 20%; font-size: 50px; } #three{ width:...
Make a table by using: display: table and table-layout: fixed display: table-cell and display: table-row Use ex as the unit measurement in this case since you have a concern about...
I suppose you don't have the options to add classes to your editor. Your footer does not use a footer tag, rather another instance of the div with class 'containerHolder'....
Have your gradient fade to the background colour, and hide any overflow so that your ::after pseudo element doesn't break out of its container: #rectangle { position: relative; width: 1280px;...
Add the below to your file in <head> section or preferably in your css include file. <style> label { display:inline-block; width:100px; } </style> And then add a <br> or two...
<!DOCTYPE html> <html> <head> <title>Inline HR</title> <style type="text/css"> div { text-align: center; } hr { display: inline-block; width: 40%; } </style> </head> <body> <div style="center"> <hr> My Text <hr> </div>...
what you want to do is possible via CSS3. It must be done thinking, that it will not be triangles for older browser. So, you start first building your slider...
They do synchronize. Try hacking http://threejs.org/examples/css3d_sandbox.html. You should be able to create a CSS3DObject and a PlaneGeometry that line up perfectly, assuming the same camera is used to render both....
First, the CSS should be: .wf_blue { background-color: rgb(2, 12, 40); } .wf_white { background-color: rgb(255, 252, 247); } In plain HTML <body class="wf_blue"> With jQuery: $(document).ready(function() { $("body").addClass("wf_blue"); });...
You should turn it into HTML first, and then pass it through highlight.
How to stretch line between two cells ( tags)
check the fiddle here <canvas id="myCanvas" width="600" height="500"></canvas> <script> var canvas = document.getElementById('myCanvas'); var context = canvas.getContext('2d'); context.beginPath(); context.moveTo(350, 50); context.lineTo(450, 350); context.stroke(); </script> CSS #myCanvas { z-index:...
This might work better, not sure if its feasible for you. .storebtns { float:left; width:100px; } <a class="storebtns" href="http://www.google.com"> <img src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcSUZXG8Fd-auKjn_fLKsFtHMIarXLlcnDoTAvV86PSxmJFLwYgzJQ" width="100"/> </a> <a...
You could check if one of td's are empty or null in the ready function using each() method then hide the div using hide() : $(function(){ var hide = true;...
How about a non CSS - no javascript/jQuery answer? <select> <option value="" disabled selected>Select your option</option> <option value="hurr">Durr</option> </select> ...
Added css: #component>div{height:100%;} #component>div:first-of-type{border-radius:30px 0 0 30px;} #component>div:last-of-type{border-radius: 30px;} Edit in js: $('#component').children().not(':last').each(function () { What happens: The last div will not float left, and will just fill the space...
You have 2 options: add a transparent border on the non-focused input. This way the size won't change on focus, and you won't get the moving effect. work with outline...
No, it is not normally OK to use CSS for all your images. The image in this case is a piece of data, just like the title and description, and...
You should consider making two different pictures, one normal and one with the background you want. An other option would be a container div ( not a good idea for...
You could do something like this: by combining selectors table.class1, table.class1 td { border: 1px solid black; border-collapse: collapse; } <table class="class1"> <tr> <td>Jill</td> <td>Smith</td> <td>50</td> </tr> <tr> <td>Eve</td>...
Just add some styles to the 3 elements: #container{ height: 80px; width: 100%; display: table; } #one{ width: 20%; font-size: 90px; } #two{ width: 20%; font-size: 50px; } #three{ width:...
Make a table by using: display: table and table-layout: fixed display: table-cell and display: table-row Use ex as the unit measurement in this case since you have a concern about...
I suppose you don't have the options to add classes to your editor. Your footer does not use a footer tag, rather another instance of the div with class 'containerHolder'....
Have your gradient fade to the background colour, and hide any overflow so that your ::after pseudo element doesn't break out of its container: #rectangle { position: relative; width: 1280px;...
Add the below to your file in <head> section or preferably in your css include file. <style> label { display:inline-block; width:100px; } </style> And then add a <br> or two...
<!DOCTYPE html> <html> <head> <title>Inline HR</title> <style type="text/css"> div { text-align: center; } hr { display: inline-block; width: 40%; } </style> </head> <body> <div style="center"> <hr> My Text <hr> </div>...
what you want to do is possible via CSS3. It must be done thinking, that it will not be triangles for older browser. So, you start first building your slider...
They do synchronize. Try hacking http://threejs.org/examples/css3d_sandbox.html. You should be able to create a CSS3DObject and a PlaneGeometry that line up perfectly, assuming the same camera is used to render both....
First, the CSS should be: .wf_blue { background-color: rgb(2, 12, 40); } .wf_white { background-color: rgb(255, 252, 247); } In plain HTML <body class="wf_blue"> With jQuery: $(document).ready(function() { $("body").addClass("wf_blue"); });...
You should turn it into HTML first, and then pass it through highlight.
How to stretch line between two cells ( tags)
check the fiddle here <canvas id="myCanvas" width="600" height="500"></canvas> <script> var canvas = document.getElementById('myCanvas'); var context = canvas.getContext('2d'); context.beginPath(); context.moveTo(350, 50); context.lineTo(450, 350); context.stroke(); </script> CSS #myCanvas { z-index:...
This might work better, not sure if its feasible for you. .storebtns { float:left; width:100px; } <a class="storebtns" href="http://www.google.com"> <img src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcSUZXG8Fd-auKjn_fLKsFtHMIarXLlcnDoTAvV86PSxmJFLwYgzJQ" width="100"/> </a> <a...
check the fiddle here <canvas id="myCanvas" width="600" height="500"></canvas> <script> var canvas = document.getElementById('myCanvas'); var context = canvas.getContext('2d'); context.beginPath(); context.moveTo(350, 50); context.lineTo(450, 350); context.stroke(); </script> CSS #myCanvas { z-index:...
This might work better, not sure if its feasible for you. .storebtns { float:left; width:100px; } <a class="storebtns" href="http://www.google.com"> <img src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcSUZXG8Fd-auKjn_fLKsFtHMIarXLlcnDoTAvV86PSxmJFLwYgzJQ" width="100"/> </a> <a...