• Page 1 of 1
  • 1
UcozBaze All Scripts And Templates » uCoz Support » Klausimai atsakymai » CSS Sprites ucoz (CSS Sprites ucoz)
CSS Sprites ucoz
GoblinaSDate: Sunday, 2011-09-11, 9:47 PM | Message # 1
Group: S-Moderator
Messages: 380
3
CSS Sprites


What is CSS sprite?


CSS sprites can be termed as a method for reducing the number of image requests to a web page by combining multiple images into a single image, and display the desired segment using CSS background-image and background-position properites. Now that almost all major browsers started supporting CSS background-image and background-position properties, CSS sprites are getting more significance.

Here I am presenting a cool overlapped pure CSS menu created using CSS sprites. This is an initial draft version, so far I have checked it only in Firefox 5.0, IE 9, Chrome 5.1 & Opera 11.0 and it looks fine. If anyone of you finds any issues in any other browsers, please let me know. Cool sprites is a pack of four different versions of the same menu.

CSS:
Code

.navi1 {
      display:block;
      height:72px;
      margin:0 auto;
      position:relative;
      width:525px; }
.navi1 ul {
      float:none;
      list-style-image:none;
      list-style-type:none;
      margin:3px 0; }
.navi1 ul li {
      background-image:url(tab-1.png);
      background-repeat:no-repeat;
      float:left;
      height:72px;
      margin:0px;
      padding-top:5px;
      position:absolute; }
.navi1 ul li a {
      display:block;
      height:100%;
      width:100%; }
.navi1 ul li.sm1 {
      background-position:0 0;
      left:0px;
      width:125px; }
.navi1 ul li.sm2 {
      background-position:-125px 0;
      left:100px;
      width:124px; }
.navi1 ul li.sm3 {
      background-position:-249px 0;
      left:200px;
      width:124px; }
.navi1 ul li.sm4 {
      background-position:-373px 0;
      left:300px;
      width:125px; }
.navi1 ul li.sm5 {
      background-position:-498px 0;
      left:400px;
      width:126px; }
.navi1 ul li:hover {
      z-index:1000; }
.navi1 ul li.sm1:hover {
      background-position:0 -75px; }
.navi1 ul li.sm2:hover {
      background-position:-125px -75px; }
.navi1 ul li.sm3:hover {
      background-position:-249px -75px; }
.navi1 ul li.sm4:hover {
      background-position:-373px -75px; }
.navi1 ul li.sm5:hover {
      background-position:-498px -75px; }


HTML:
Code

<div class="navi1">
    <ul>
      <li class="sm1"><a href="#"></a></li>
      <li class="sm2"><a href="#"></a></li>
      <li class="sm3"><a href="#"></a></li>
      <li class="sm4"><a href="#"></a></li>
      <li class="sm5"><a href="#"></a></li>
    </ul>
</div>


 
Message
CSS Sprites


What is CSS sprite?


CSS sprites can be termed as a method for reducing the number of image requests to a web page by combining multiple images into a single image, and display the desired segment using CSS background-image and background-position properites. Now that almost all major browsers started supporting CSS background-image and background-position properties, CSS sprites are getting more significance.

Here I am presenting a cool overlapped pure CSS menu created using CSS sprites. This is an initial draft version, so far I have checked it only in Firefox 5.0, IE 9, Chrome 5.1 & Opera 11.0 and it looks fine. If anyone of you finds any issues in any other browsers, please let me know. Cool sprites is a pack of four different versions of the same menu.

CSS:
Code

.navi1 {
      display:block;
      height:72px;
      margin:0 auto;
      position:relative;
      width:525px; }
.navi1 ul {
      float:none;
      list-style-image:none;
      list-style-type:none;
      margin:3px 0; }
.navi1 ul li {
      background-image:url(tab-1.png);
      background-repeat:no-repeat;
      float:left;
      height:72px;
      margin:0px;
      padding-top:5px;
      position:absolute; }
.navi1 ul li a {
      display:block;
      height:100%;
      width:100%; }
.navi1 ul li.sm1 {
      background-position:0 0;
      left:0px;
      width:125px; }
.navi1 ul li.sm2 {
      background-position:-125px 0;
      left:100px;
      width:124px; }
.navi1 ul li.sm3 {
      background-position:-249px 0;
      left:200px;
      width:124px; }
.navi1 ul li.sm4 {
      background-position:-373px 0;
      left:300px;
      width:125px; }
.navi1 ul li.sm5 {
      background-position:-498px 0;
      left:400px;
      width:126px; }
.navi1 ul li:hover {
      z-index:1000; }
.navi1 ul li.sm1:hover {
      background-position:0 -75px; }
.navi1 ul li.sm2:hover {
      background-position:-125px -75px; }
.navi1 ul li.sm3:hover {
      background-position:-249px -75px; }
.navi1 ul li.sm4:hover {
      background-position:-373px -75px; }
.navi1 ul li.sm5:hover {
      background-position:-498px -75px; }


HTML:
Code

<div class="navi1">
    <ul>
      <li class="sm1"><a href="#"></a></li>
      <li class="sm2"><a href="#"></a></li>
      <li class="sm3"><a href="#"></a></li>
      <li class="sm4"><a href="#"></a></li>
      <li class="sm5"><a href="#"></a></li>
    </ul>
</div>

Author - GoblinaS
Date Added - 2011-09-11 в 9:47 PM
UcozBaze All Scripts And Templates » uCoz Support » Klausimai atsakymai » CSS Sprites ucoz (CSS Sprites ucoz)
  • Page 1 of 1
  • 1
Search:
                                                               
Statistics Forum
New Posts Popular topic Top Forum Users New User

type list Appearance of entries movie site for uCoz (0)
type list Google preloader on pure CSS ucoz (0)
type list Pre-Loader for a site on pure CSS (Transition) ucoz (0)
type list Script to disable the F12 key and right-click ucoz (0)
type list Animated button for downloading using SVG and Vue UCOZ (0)
type list Top Forum Users ucoz (0)
type list Snow script for your website ucoz (0)
type list Original watch without digits ucoz (0)
type list Bookmark Buttons Generator (0)
type list Automatically add tags for all uCoz modules (6)
type list How to customize the design of the site for mobile version (3)
type list Video player for uCoz (3)
type list Auto Youtube Trailers for Ucoz Movies Web (0)
type list Pranešimai skrti jums yra matomi Tag Board Ucoz skriptas (1)
type list Why can’t I copy large files over 4GB to my USB flash drive (0)
type list Forumo Informatorius (2)
type list Pereiti i kita puslapi forume 1.2.3. Ucoz skriptas (1)

type list Skaiciuojam nuo 1 iki 1000 ! (557)
type list Forum SignatureBar (60)
type list Avatars (22)
type list Juokingos Fotkes :) (19)
type list Kaip pakeisti paveiksla mazas? (19)
type list Mini-Chatas islendantis is sono ucoz (15)
type list Mp3-Tau.do.am (13)
type list Шаблон форума для ucoz For-css (12)
type list Ucoz script - favicon (11)
type list Megsti samp? Ateik cia (10)
type list Button scrolling up ucoz (10)
type list Slider KinoPlius Help to setup :) (10)
type list Apklausa Jūsų Svetainei New ucoz (10)
type list KinoPlius (9)
type list SexMergytes.do.am (9)
type list Money for the forum ucoz (9)
type list 11.17.2011 (9)
type list Puslapis "Atliekami techniniai darbai" Ucoz scriptas (9)
type list User personal Page ucoz (8)
interout
Forum Posts: 1027
Comments: 51
Reputation: 83
Rank:
GoblinaS
Forum Posts: 380
Comments: 15
Reputation: 25
Rank:
Adi
Forum Posts: 179
Comments: 11
Reputation: 23
Rank:
Esquire
Forum Posts: 147
Comments: 8
Reputation: 5
Rank:
BAtman
Forum Posts: 129
Comments: 1
Reputation: 18
Rank:
WaSHkaZ
Forum Posts: 83
Comments: 0
Reputation: 3
Rank:
Skacikas
Forum Posts: 71
Comments: 0
Reputation: 12
Rank:
meskis
Forum Posts: 51
Comments: 0
Reputation: 25
Rank:
Gytenas
Forum Posts: 51
Comments: 0
Reputation: 1
Rank:
vicka
Forum Posts: 50
Comments: 1
Reputation: 4
Rank:
Samartinean
Forum Posts: 0
Comments: 0
Reputation: 0
Rank:
Азиза_Азизи
Forum Posts: 0
Comments: 0
Reputation: 0
Rank:
woscs1-6
Forum Posts: 0
Comments: 0
Reputation: 0
Rank:
Matruka
Forum Posts: 0
Comments: 0
Reputation: 0
Rank:
ArEzO
Forum Posts: 0
Comments: 0
Reputation: 0
Rank:
masterkmv74
Forum Posts: 0
Comments: 0
Reputation: 0
Rank:
bloody-warrior1
Forum Posts: 0
Comments: 0
Reputation: 0
Rank:
constantinm188
Forum Posts: 0
Comments: 0
Reputation: 0
Rank:
doctor_server
Forum Posts: 0
Comments: 0
Reputation: 0
Rank:
paynergroup
Forum Posts: 0
Comments: 0
Reputation: 0
Rank:


Site design by uCozBaze
uCozBaze © 2011-2016