How to sprite body background in CSS
Tags: css
Problem :
I'm working on small php script.
I have problem with css sprites. I have image with 96px the left side is 48px the right side is 48px. I want to use the left side of image as body background. And i want to use the right side of the image as backgroud of div. The problem is i don't know how to use the left side as background.
Help please.
Solution :
You can't. Sprites only work when you can limit the size of the element to the size of the section of the image you want to display.
Use separate images.
CSS Howto..
You just need to do the same as what you did with the other elements. In you css add the input:checked and the textarea:valid input[type="description"]:valid, input[type="text"]:valid, input[type="name"]:valid, input[type="password"]:valid, input[type="email"]:valid, input[type="checkbox"]:checked,...
I'm not going to give you complete solution, but some hints how it should be achieved: Use radial gradient to get background lighter in the center and darker near the...
Printing support by all browsers is very poorly supported with horrendous bugs in many popular browsers that have gone unfixed for years. The short answer is to avoid HTML/CSS printing...
https://jsfiddle.net/xhzxduz2/2/ CSS nav { position: fixed; left: 0; top: 0; background: red; height: 48px; min-width: 320px; width: 100%; } .content { max-width: 960px; margin: 0 auto; color: white; background: blue;...
One simple way of doing it is as follows: Wrap your text in an inline element, for example, <span>: <ul> <li><span>first</span></li> <li><span>second</span></li> <li><span>third</span></li> </ul> And apply the following CSS: ul...
To address your questions: How do I create a new table class that inherits from the base table? If you do not have a css file that resets all style...
Why wouldn't you use just absolute positioning? Check this out: http://jsfiddle.net/hPpTV/ #header, #container, #left, #left-top, #left-bottom, #right, #footer { position: absolute; } #header { top:0; height: 60px; width: 100%; }...
The drag function provides to parameters into it's callback. event and ui. The ui has a property called ui.position which contains left and top. When the drag strats, remove the...
Using a browser specific stylesheet is no different in ASP .NET MVC. You put the if statement and point to the stylesheet. See more here. You can put your stylesheet...
You can comma seperate box-shadow: #borders { border-top: 20px solid black; box-shadow: -20px 0 0 0 red, 20px 0 0 0 red; border-bottom: 20px solid green; height: 150px; margin: 30px;...
You cannot format a select element as a table, since the content of option elements is plain text, so you cannot designate any parts there as table cells. The best...
.nav-sec-level{ background: red; border:1px solid #000; display: none; } .side-bar:hover .nav-sec-level{ display: block; } <ul> <li class="side-bar"> <a>gh kl</a> <ul class="nav-sec-level">some menu <li>jdfs</li> <li>jdfs</li> <li>jdfs</li> </ul>...
This page should help you with grids... http://demos.jquerymobile.com/1.4.1/grids/ If you need to have the form elements inline (side by side) you should also be able to use grids to complete...
i guess this is what you are looking for : .container { position:relative; overflow:hidden; width:300px; height:200px; } .img { width:100%; height:100%; background:blue; } .slidemeup{ background:red; position:absolute; bottom:-50px;; height:50px; width:100%; left:0;...
fiddle $(document).ready(function(){ $(".tab ul li:nth-child(1)").click(function(){ $(".box1").fadeIn(); $(".box2").hide(); $(".box3").hide(); $(".tab ul li").css("background", "red") $(this).css("background", "blue") }); $(".tab ul li:nth-child(2)").click(function(){ $(".box2").fadeIn(); $(".box1").hide();...
Add the following css below your css .dropDownBox option { font-size: 13px; color: #3b3b3b; padding: 5px; background: -moz-linear-gradient( top, #f0f0f0 0%, #d6d6d6); background: -webkit-gradient( linear, left top, left bottom, from(#f0f0f0),...
How about this for html <div class="chatBody"> <div id="navlist"> <div class="tile active"> <div class="frdImage"></div> <div class="stuff"> <div class="frdName">Igor Gomes</div> <div class="frdStatusIndicator online"></div> <div...
You can actually accomplish this sort of effect without any images whatsoever using the CSS triangle hack. I've created a jsFiddle with a working example: http://jsfiddle.net/P8W7F/
Due to the way that you have your CSS written, you will want to change the following rule in your css file: #nav li:hover li:hover ul, #nav li:hover li:hover li:hover...
This is a known issue where the element does not register as being empty. You can fix it with a simple jquery function call to empty the element: $input.empty(); See...
Using border-image: We can make use of the border-image to assign a linear-gradient as the border image on all the four sides. We would need a pseudo-element (overlapping the parent...
It might be a little hacky but you could always apply the transition to your div on click as well. Did this pretty quick but it works. Check out the...
From https://github.com/calitek/BasicStarterWP; webpack.config.js var path = require('path'); var ExtractTextPlugin = require("extract-text-webpack-plugin"); const ROOT_PATH = path.resolve(__dirname); const SRC_PATH = path.resolve(ROOT_PATH, 'ui-src', 'app.js'); const DIST_PATH = path.resolve(ROOT_PATH, 'ui-dist');...
No, the border is a property of the child element, and thus can only be specified on them. You can use a single rule for this, but it requires advanced...
How can I reference in CSS the div after each h3 so I can set a style that I want to apply to all first div after any h3...
Use: div.row { margin-top: 12px; } or .row { margin-top: 12px !important; } ...
Media Queries is what you want, here's a good overview:
See this Demo <a href="#" class="linkhover"> <span hover-title="LINK HOVER">LINK HOVER</span> </a> .linkhover { display: inline-block; overflow: hidden; perspective: 400px; -webkit-perspective: 400px; perspective-origin: 50% 50%; -webkit-perspective-origin: 50% 50%; } .linkhover span...
I sort of figured how to make the arrow display using CSS. But, am stuck with the rest of it. You are on the right track. Just a couple...
simple to use floats - this fiddle should set you on the right path: http://jsfiddle.net/Q4paq/ New example with DIVs containg a link with a hover state. http://jsfiddle.net/Q4paq/1/...