Easy Ways To Center An Object With CSS

One of the aspects that appeal to the majority of all concerned website designers is centering any element with the help of CSS. It certainly can be considered to be the best thing that can prove to be of real importance so as to be able to align any element at the centermost position. However, it needs to be made clear that the act of centering any element for any website designer is never an easy task.

Easy Ways To Center An Object With CSS

However, it needs to be made clear that the act of centering any element for any website designer is never an easy task. Center An Object With CSS
Center Different Things
The reason behind the same is that there is vast number of things that can be useful for the purpose of centering different elements. Also, it is not the case that every single technique will prove to be working fine along with every single element. With the help of the Cascading Style Sheet, you will be able to center things in different ways. A few among many of the ways that will help you to be able to position the items can be as highlighted as below:

  • Centering Block
  • Centering Text
  • Vertical Centering
  • Centering An Image

Center Text
One of the easiest things that can be centered without the least degree of the problem is text. An element that can be used for the purpose of aligning the text at the center position is text-align. The best way that will help you in centering paragraphs is p.center {text-align: center ;}. Every single paragraph, which is written within the “center” class, will be centered in a horizontal position. There are a few things which you are supposed in bear in mind if you are planning to center text with the help of the text-align property:

  • If you make use of text-align property, in order, to center text, the same will remain centered along within the container element.
  • The same holds a similarity with the alignment of text. The alignment that you can associate along with the same includes; justified alignment, left alignment and right alignment, as well.

Definite Width Value
Do you know as to what are blocks? Well, blocks can be referred to as the elements that enjoy certain width value. The best way that will help you in being able to center blocks with the help of Cascading Style Sheet is setting both the right and left margins to
“auto”. In this respect, you are supposed to stay informed that as long as the block boasts of a definite width, it will always be able to get itself centered inside the element that is containing the same. However, you also need to realize that every single element that is contained within the block will not be centered.
If you are contemplating the alternative of centering the position of images, you must be able to realize that the task seems to be a bit trickier. Irrespective of the fact; that it is possible to center align the images by means of making use of the same attribute, the same is never considered to be the right choice. The reason behind the same is that the same does not enjoy recommendation by the W3C. This is one of the reasons as to why; you will not be finding any recognized web design company to be implementing the same technique. Rather, it is a nice thought to let your browser know that the image needs to be considered as a block element. The fact as to whether; it will be possible to centre the entire content of your webpage depends on the aspect of using a fixed width layout. It is a nice thought to search the different online resources, in order, to learn as to what are the different ways that will help you in being able to center the element at the center position.

5 CSS-Generating Tools to Help with Small Code Tasks

Building CSS is often a challenging task. There are, at times, some coding that are really difficult to learn. Thus, it is better to confer the task to a competent website design company so that their developers can handle it professionally. However, if you want to learn more about the Cascading Style Sheets or CSS, there are some CSS-generating tools that can help you with small code tasks. And knowing about them will help you to have more freedom to enhance the developing experiences, add more features and implement your creative ideas. Besides, owners of ecommerce websites will specially benefit from such knowledge as it will help them generated codes online without the need of hiring a developer for every little purpose.

5 CSS-Generating Tools to Help with Small Code Tasks

Building CSS is often a challenging task. there are some CSS-generating tools that can help you with small code tasks. knowing CSS-Generating Tools to Help.

 

5 CSS-Generating Tools to Help with Small Code Tasks
5 CSS-Generating Tools to Help with Small Code Tasks

The following are 5 CSS-generating tools that will make the task of your website designs even easier.

CSS3 Generator

This is simple and free tool that will help you with the website designs by generating effective CSS. CSS3 Generator can be used for creating shadows, borders, boxes, transitions changes and other effects on website. It allows you to customize twelve options and you can check them one by one and see the effects on each option on your site. It offers a drop down menu and it requires the user to select one particular option for generating the specific code. However, this tool has certain limitations.

css 1

CSS3 Maker

A premium featured tool, CSS3 Maker allows code generation of text rotation, borders, adding shadow to text and boxes, field transformation and animation, and more. This tool makes it easy to ensure the browser compatibility. Besides, it offers limited compatibility with various mobile device OS. In fact, CSS3 Maker features multiple versions of applications for BlackBerry OS and iOS. It allows the user to crate CSS easily with less coding. There are 10 different categories to choose from including common coding of CSS Transform, Border Radius, Gradient, CSS Animation, Text Shadow, Box Shadow, CSS Transition, RGBA, Font Face and Text Rotation.

Ultimate CSS Gradient Generator

This tool is simple and easy to use that allows generating multi-color gradient for your webpage or button. After you have selected a color in the ‘preset’ box option, this tool allows you to add effects by other existing options. Ultimate CSS Gradient Generator also allows complete customization.

CSS Creator

css

Another simple tool, CSS Creator helps to create codes of some basic web page styles. You can choose from 30 open fields, which gives the freedom to make more adjustments simply by clicking the headings, List, Table, Div/Span and Form check boxes. More fields will appear with ever new adjustment you make. It even features options for text decoration of basic types such as Underline, Strikethrough, or Over line. The page will automatically change every time you make an alteration to take the effects live. After you are done with the desired changes for your website designs, click the button “Generate CSS” and you will get your custom CSS in a new page. Copy the code and paste it into the style sheets of your website.

Border Radius

Border Radius is an online tool that allows only border radius effects coding. A simple to handle tool; however, you have to check the grey check boxes that are entered automatically with default value “0”. Just write the custom number and the changes will appear automatically inside the box. There are 3 check box options available.

100+ jquery and CSS techniques and tutorials

Jquery is most popular and used javascript library which is used for multiple purpose. Every developer is using CSS and Jquery for modifying the UI and usability. Here I collected the more then 100 jquery and CSS techniques and tips and tutorials in this article. This articles are useful for every Jquery developers.

We collected the more then 100 jquery and CSS techniques and tutorials in this article.

jquery and CSS techniques and tutorials

jquery and CSS techniques and tutorials
jquery and CSS techniques and tutorials

Galleriffic

Photo Zoom Out Effect with jQueryJquery is most popular and used javascript library which is used for multiple purpose. Every developer is using CSS and Jquery for modifying the UI and usability. Here I collected the more then 100 jquery and CSS techniques and tips and tutorials in this article. This articles are useful for every Jquery developers.

Interactive Photo Desk with jQuery and CSS3
In this little experiment you will create an interactive photo desk that provides some “realistic” interaction possibilities for the user. The idea is to have some photos on a surface that can be dragged and dropped, stacked and deleted, each action resembling the real world act.

Create A Multiple URL Shortener Page

A Colorful Clock With CSS & jQuery

You will learn how to build a highly original colorful jQuery & CSS clock using Tutorialzines very own jQuery plug-in – tzineClock.

Colorful Rating System with CSS3

Color Lines Free Font

Micro Image Gallery: A jQuery Plugin

By using the jQuery Color plugin, you can animate colors. Simply use the animate() function from jQuery to have colours fade to another colour. When using this technique, combined with some CSS3 features (rounded corners and drop shadow), you can create a Colorful rating system.

jQuery DJ Hero

Remember jTypingHero? This was a fun little game to test your typing skills based on the ever popular Guitar Hero. By combining CSS3 and jQuery, you will create, in this experimental tutorial, two records that you can start spinning (faster and slower) and even scratching is enabled.

Floated lists with CSS3 and jQuery

In this quick tutorial, the developer is going to explain how you can have a nicely floated list of items and you will use jQuery to make sure IE understands it too.

Cross-Browser Rounded Buttons with CSS3 and jQuery

CSS3 & jQuery Image Gallery and Slider Tutorials
An Awesome CSS3 Lightbox Gallery With jQuery

In this tutorial you are going to create an awesome image gallery which leverages the latest CSS3 and jQuery techniques. The script will be able to scan a folder of images on your web server and build a complete drag and drop lightbox gallery around it.

Contextual Slideout Tips With jQuery & CSS3

Annotation Overlay Effect with jQuery

CSS3 Glow Tabs
You will learn how to recreate the ‘hover glow tabs’ from the jQuery Conference page, which has a nice “glowing” rollover effect along with a subtle inner shadow at the bottom of the inactive tabs and also applied some rounded corners and gradients to complete a very nice effect.

Recreating the MLB.com Content Switcher
The goal of this project is to try to recreate the Flash content switcher from MLB.com, using jQuery and CSS3 and without any extraneous images or other non-essential elements that tend to make stuff less maintainable.


Pretty Simple Content Slider
You will learn how to create an auto-playing content slider with jQuery and CSS3. The idea is to alter the background image and to slide in the heading and the description. By clicking on one of the menu items, the auto-play function is stopped and the respective content slides out.

Why and how to create Microsoft Office Minibar

In this tutorial you will learn how to recreate a variation of MS Words (2007) toolbar that exposes context-related functionality. When user makes a selection in the input field, a Minibar pops up, semi-transparent, above the selection. It disappears when user clicks anywhere in the input field or performs an action by clicking on a Minibar button.

Making a Sleek Feed Widget With YQL, jQuery & CSS3
In this tut you will larn how to build a sleek feed widget, that will fetch any RSS feed and display it in your blog sidebar. You can set it to show the latest blog posts from different categorie, your latest stumbles, or it even display your Twitter mentions.

Awesome Image Gallery using CSS3 and jQuery
The simple CSS3 image gallery (with jQuery) you will be building will be slightly tilted to the side and on hover will move and whenever you click on the image a lightbox will pop out with the larger version of the image.

Kick-Ass jQuery & CSS3 Gallery With Animated Shine Effects
You will be shown how you can create a kick-ass animated Shine Effect with jQuery & CSS3 and then use it to create your very own Shiny Gallery ‘ShineTime’. This effect is useful in making your user interface elements look like they’re a real polaroid photo (or made of glass) and the best part is, it’s not that difficult to achieve.

A Sexy Vertical Sliding Panel Using jQuery And CSS3
Here you can learn how to make a vertical sliding panel that will act as some sort of drawer instead of the usual top horizontal sliding panel that pushes everything else down when it is open.

Pure CSS3 Bokeh Effect with some jQuery help
IThe bokeh effect is currently a very popular trend amongst designers and in this unique tutorial you will learn how to create a pure CSS3 version of the effect. With some help from jQuery, you can add some randomness the the colors, sizes and vary the positions of the effect.

Create a Nifty Dynamic Shadow with jQuery
Here, Daniel Kurdoghlian, will show you how to recreate the very nifty looking dynamic shadow effect he created for his very popular CSS3 and jQuery experiment. He walks you through every step of the tutorial by using a few teaspoons of jQuery, a pinch of CSS and some transparent PNG’s as Base.

Create A Multiple URL Shortener Page
In this tutorial, you’ll be shown how to create a simple page that will show short urls created by multiple url shortener services. You’ll be using HTML5, CSS3 for styling as well as jQuery for working with Ajax.

Feature Table Design

In this experimental tutorial you will learn how to recreate the ‘sexy’ table design from Shopify, firstly in Photoshop and then in HTML/CSS.

Simple AJAX Commenting System

In this tutorial you will learn how to build a Simple AJAX Commenting System. It will feature a gravatar integration and demonstrate how to achieve effective communication between jQuery and PHP/MySQL with the help of JSON.

Beautiful Looking Custom Dialog Box With jQuery and CSS3
This dialog box uses CSS3 drop shadow and a completely CSS3 styled button. So, latest version of Chrome, Firefox and Safari will have no problems with it, but for IE6 and 7, the script will work but the display of the dialog box will look plain, no rounded border, drop shadow and gradient.

Making a Mosaic Slideshow With jQuery & CSS
When designing a product page, it is often necessary to present a number of images in a succession, also known as a slideshow. In this technique you will be making a jQuery & CSS mosaic gallery, featuring an interesting tile transition effect when moving from one slide to another.

Beautiful Photo Stack Gallery with jQuery and CSS3
In this tutorial you are going to create a nice and fresh image gallery. The idea is to show the albums as a slider, and when an album is chosen, you show the images of that album as a beautiful photo stack. In the photo stack view, you can browse through the images by putting the top most image behind all the stack with a slick animation.

Interactive Image Vamp up with jQuery, CSS3 and PHP
In this technique you will be shown how to create an online application for giving some funny touches to an image, using jQuery and jQuery UI for dragging and resizing little bling elements like mustaches and glasses. With PHP the image and the bling elements will get merged and the end result can be viewed.

CSS3 & jQuery Image Effects
Image Highlighting and Preview with jQuery
In this tutorial you will be shown how to highlight and preview images that are integrated in an article or spread over a page. This is a nice way to allow users to view a bigger version of an image that is relevant to some context.

CSS3 Rounded Image With jQuery
In this tutorial you will learn how to give an image rounded corners using the CSS3 border-radius and box-shadow properties and using jQuery to automatically wrap a span tag around the image.

Apple-like Retina Effect With jQuery
In this tutorial you will learn the technique of turning a static image into a fully functional “Retina effect” with only jQuery and CSS.
A Fresh Bottom Slide Out Menu with jQuery

COIN SLIDER

Interactive Photo Desk with jQuery and CSS3

menu using CSS3 transitions.

CSS3 & jQuery Menu and Navigation Tutorials
Contextual Slideout Tips With jQuery & CSS3
With this tut you will learn how to make a set of contextual slideout tips with jQuery & CSS3, which are ideal for product pages and online tours. As a bonus, they are SEO friendly, so all the content is visible to search engines.

Automatic Image Slider w/ CSS & jQuery

Simple Tooltip w/ jQuery & CSS

Piecemaker XML Gallery

How to Create a Drop-down Nav Menu

Awesome CSS3 & jQuery Slide Out Button

qTip – The jQuery tooltip plugin

Elegant Accordion with jQuery and CSS3
Here you will create an elegant accordion for your sites content. The idea is to have some vertical accordion tabs that slide out when hovering. You will add some CSS3 properties to enhance the looks.

Interactive Image Vamp up with jQuery, CSS3 and PHP

Elegant Accordion with jQuery and CSS3

Full Page Image Gallery with jQuery

Create a “Stay-On-Top” Menu with CSS3 and jQuery

Create Your Own Dashboard Menu
A Fresh Bottom Slide Out Menu with jQuery

In this tutorial you will create a unique bottom slide out menu. This large menu will contain the title and a description of the menu item and it will slide out from the bottom revealing the description text and icons. You will use some CSS3 properties for some nice shadow effects and jQuery for the interaction.

Sweet AJAX Tabs
Organizing the content of a page in a both intuitive and eye-catching manner, is a must in modern web design. One principle that has been around for some time is dividing text into tabs. In this tutorial you will be making an AJAX-powered tab page with CSS3 and version 1.4 of jQuery

Lens Flare

Mac-style Skype Application Menu
Using CSS3 and jQuery for extra functionality you will learn how to recreate the amazing slick Skype (for Mac) layout. (Not the full layout: Only the menu where all your friends are listed).

Making a Mosaic Slideshow With jQuery & CSS

SlideNote

Nice And Simple Toolbar For Your Website

In this tutorial you’ll learn how to build a nice toolbar for your website using some CSS3 properties and basic jQuery techniques.

SuperSized

jqFancyTransitions

Cloud Carousel – A 3d Carousel in Javascript

CSS3 Styled jQuery Dropdown

Beautiful Photo Stack Gallery with jQuery and CSS3

Create a awesome images gallery using css3 and jquery

In this tutorial you are going to create your very own dashboard menu similar to Leopards dashboard.

Image Cross Fade Transition

imgAreaSelect

jquery and CSS techniques and tutorials

Awesome CSS3 & jQuery Slide Out Button

Open Standard Media Player

Pretty Simple Content Slider with jQuery and CSS3

CSS3 Rounded Image With jQuery

Halftone Navigation Menu
In this tut you will be making a CSS3 & jQuery halftone-style navigation menu, which will allow you to display animated halftone-style shapes in accordance with the navigation links, and will provide a simple editor for creating additional shapes as well.

Image Highlighting and Preview with jQuery

jQuery Smooth Tabs Plugin

Create Accordion Menu Using CSS3 Transitions
There are many ways to create an accordion menu, most of them use a javascript library like jQuery to make the effect runs cross browsers. In this tutorial, you’ll see how to make an accordion

jPlayer – jQuery mp3 player plugin

QuickSand

Colorful Sliders With jQuery & CSS3

prettyPhoto

Sponsor Flip Wall With jQuery & CSS
ImageFlow

HoverFade

Nivo Slider

Circular Motion Effect with jQuery

How to Create a Nifty Dynamic Shadow with jQuery

jQuery-Notes

jQuery plugin: Easy Accordion

jQuery quickie: Colourful rating system with CSS3

Growl

Control.Tabs

Javascript game engine for jQuery

20 best CSS tips and Techniques for web designers

In this article we collected some of the best CSS tips and Techniques for web designers. CSS is most important part of every web application.

CSS tips and Techniques
CSS tips and Techniques

CSS tips and Techniques

How To Use CSS3 Orientation Media Queries
Take Your Design To The Next Level With CSS3
15. CSS3 Font-Face Or How To Use A Custom Font For Your Website
CSS3 Fundaments – CSS3 Transitions
Design A Prettier Web Form With CSS3
Create A Sticky Note In 5 Easy Steps With CSS3 And HTML5
Quick Tip : The Multi Column CSS3 Module
Exciting Functions And Features
Quick Tip : Understanding CSS3 Gradients
How To Create Inset Typography With CSS3
Build Awesome Practical CSS3 Buttons
The State Of CSS3
CSS3 Transitions – Are We There Yet?
Create A Color Changing Website Using CSS3
Photoshop Effect vs CSS3 Properties
Create A Beautiful Looking Custom Dialog Box With jQuery And CSS3
Get The Best Out Of CSS3
Fundamental Problems With CSS3
Pretty CSS3 Buttons
Going Nuts With CSS3 Transitions

50 CSS Tequniqe and Tips every web developer should check

Many Developer want to do work in CSS. Web Developer has special value for CSS. Since CSS 2.0 and CSS 3.0 came many techniques and Tricks invented by Web developers. Here I am giving you some list of CSS Tips. You can found following links very useful and powerful for your website while developing your website.

50 CSS Tequniqe and Tips every web developer should check

50 CSS Tequniqe and Tips every web developer should check
50 CSS Tequniqe and Tips every web developer should check
  • Multiple Columns
  • Multiple Backgrounds
  • Creating A Realistic Looking Button With CSS3
  • 56. A Crash Course In Advanced CSS3 Effects

What is reset css and How to use the reset CSS

Many new web developers or web application developers may be did not hear about reset CSS. Many web developers use the global selectors and global CSS styling. That is very basic reason behind that. They want to display their CSS style across the various browsers.

What is reset css and How to use the reset CSS

The goal of a reset stylesheet is to reduce browser inconsistencies in things like default line heights, margins and font sizes of headings, and so on. With reset CSS you are overriding the setting of various browser setting and elements. There are inconsistencies with every browser. For reducing the issues and setting of browser you need to reset the browser properties.

What is reset css and How to use the reset CSS
What is reset css and How to use the reset CSS

With reset CSS you can set the border, font color, color, margin, padding, img, h1, a, etc properties. The problem is that every browser’s stylesheet has subtle but fundamental differences. By using a CSS reset. There are many big sites and tool available for using the reset the CSS.

In reset CSS you need to use the most common HTML tags and their properties for reset there CSS properties.

you can also create you reset CSS as per your website need. There are many useful and good reset available. I like the YUI reset CSS most because that is really useful.

For using the YUI reset CSS you need to just add the following line in your website.

<!-- Source File -->
css" href="http://yui.yahooapis.com/3.2.0/build/cssreset/reset-min.css">

For more information about YUI reset css you can visit the following URL
http://developer.yahoo.com/yui/3/cssreset/

Following reset css is most common in each and every website and following code is useful for every website.

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
	margin: 0;
	padding: 0;
	border: 0;
	outline: 0;
	font-size: 100%;
	vertical-align: baseline;
	background: transparent;
}

Reset CSS is really useful for every website. do use the reset CSS in you stylesheet. There is another good reset CSS called blueprint which you download from following URL.
http://code.google.com/p/blueprintcss/.


Some people are saying dont use the reset css because that will increase the your css size but I must admin this thing.
you should use the reset css that will save your big time.

What is reset css and How to use the reset CSS
What is reset css and How to use the reset CSS

compress javascript and css files

Many times we are searching for Javascript and css compression. So here we collected some great web resources which are useful for compress javascript and CSS files.

Use following steps to compress javascript and css files

Few days before i was searching for Jquery JS library compression.

compress javascript and css files
compress javascript and css files

Yes there is compressed version available but i want to make some changes in JS files as per my project requirements.
So i want to compress my JS and CSS files without getting any error.
YUI Compressor 2.4.2. is the very nice tool for that. But i dont want to spend time on how YUI compressor is working.

So here is solution- I got online YUI compressor.
You can use that:
http://refresh-sf.com/yui/
It has very nice options.

http://compressor.ebiene.de/

http://www.cssdrive.com/index.php/main/csscompressor

how to create text with shadow using css

This tutorial we explains, how to create a text with shadow using CSS. We given the code sample with there full details.

how to create text with shadow using css

how to create text with shadow using css
how to create text with shadow using css

First let’s create a structure of our text container together with a text.

HTML code:

[/html]

<html >
<head>

css” rel=”stylesheet” type=”text/css” media=”screen” />

</head>

<body>
<div id=”wrapper”>
<span> wordpressAPI.com</span>
<span> wordpressAPI.com</span>
</div>

</body>
</html>

[/html]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Now we are going to apply CSS code.

CSS code:


* {
margin: 0px;
padding: 0px;
}
body {
background-color:#9BCDFF;
font-family: Verdana, Arial, sans-serif;
font-size: 11px;
text-align: center;
}
#wrapper {
width: 700px;
height: 200px;
margin: 20px auto 20px auto;
padding: 0px;
text-align: left;
position: relative;
border: solid 1px #fff;
}
.firstlayer {
font-size: 30px;
font-weight: bold;
color: #fff;
position: absolute;
top: 20px;
left: 20px;
z-index: 1;
}
.secondlayer {
font-size: 30px;
font-weight: bold;
color:#666666;
position: absolute;
top: 22px;
left: 22px;
z-index: 0;
}

~~~~~~~~~~

Thank you!


how to change opacity of image on hover css

In this tutorial we will explain you, how to change opacity of image on hover css, We used only CSS to change the opacity of image. When mouseover event triggered, we can change opacity of image using only CSS code.

how to change opacity of image on hover css

It can use for menu items and much more.

how to change opacity of image on hover csshow to change opacity of image on hover csshow to change opacity of image on hover css

first create a folder to contain this whole project, save the three images above in the folder.

Now open your favorite html editor, (notepad, dreamweaver etc).

First we will add the css styles at the top.

That was the styles tag, you can do it in the html file, or export it to an external .css file (then remember to delete thetags).

Now we just need to place our elements with html code, and assign some classes to them to make this effect work.

As you might see its quite simple, first I make a div box just as a wrapper to hold the images.

then every image is shown in as a href link with an class calling for the style “opacityit” rollover effect.

If you have trouble making it work you can download a project here, remember if it still doesnt work, check if you use a browser that supports the opacity filter effect.

Thank You!

how to create a horizontal dropdown menu with html css

CSS tutorial, Here in this article we explained, how to create a horizontal dropdown menu with html css. We given CSS code with screenshots.

This tutorial explains how to build horizontal lists using “display: inline”.

There are many methods that can be used to making a horizontal list. The main ingredient is “display: inline”, applied to the “LI” element.

Step 1: Make a basic list

Start with a basic unordered list. The list items are all active (wrapped in <a href=”#”> </a>) which is essential for this list to work. Some CSS rules are written exclusively for the “a” element within the list items. For this example a “#” is used as a dummy link.

HTML CODE
<div id="
topnav">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Product</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">About</a></li>
</ul>
</div>

Step 2: Remove the bullets

To remove the HTML list bullets, set the “list-style-type” to “none”.

how to create a horizontal dropdown menu with html css
how to create a horizontal dropdown menu with html css

CSS CODE
#topnav ul

{

list-style-type: none;

}

HTML CODE
<div id=”topnav">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Product</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">
Contact</a></li>
<li><a href="#">About</a></li>
</ul>
</div>

Step 3: Remove padding and margins

Standard HTML lists have a certain amount of left-indentation. The amount varies on each browser. Some browsers use padding (Mozilla, Netscape, Safari) and others use margins (Internet Explorer, Opera) to set the amount of indentation.

To remove this left-indentation consistently across all browsers, set both padding and margins to “0” for the “UL”.

CSS CODE
#topnav ul

{

margin: 0px;

padding: 0px;

list-style-type: none;

}

HTML CODE
<div id=”topnav">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Product</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">
Contact</a></li>
<li><a href="#">About</a></li>
</ul>
</div>

Step 4: Display inline

To force the list into one line, apply “display: inline;” to the “LI”.

CSS CODE

#topnav ul
{
margin: 0px;
padding: 0px;
list-style-type: none;
}
#topnav ul li
{
display: inline;
}

HTML CODE
<div id=”topnav">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Product</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">
Contact</a></li>
<li><a href="#">About</a></li>
</ul>
</div>

Step 5: Removing text decoration

At this point you may wish to remove the text underline. It is a common practice for navigation not to have underlines as their placement and other feedback mechanisms make them more obviously links. However, you should be aware that modifying standard hyperlink behaviour (such as underlines) can be confusing for some users, who may not realise that the item is a link.

CSS CODE

#topnav ul
{
margin: 0px;
padding: 0px;
list-style-type: none;
}
#topnav ul li
{
display: inline;
}
#topnav ul li a
{
text-decoration:none;
}

HTML CODE
<div id=”topnav">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Product</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">
Contact</a></li>
<li><a href="#">About</a></li>
</ul>
</div>

Step 6: Padding around list items

To make each list item into a box, we need to add padding to the “a” element.

CSS CODE

#topnav ul
{
margin: 0px;
padding: 0px;
list-style-type: none;
}
#topnav ul li
{
display: inline;
}
#topnav ul li a
{
text-decoration:none;
padding: 1em 1em;
}

HTML CODE
<div id=”topnav">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Product</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">
Contact</a></li>
<li><a href="#">About</a></li>
</ul>
</div>

Step 7: Adding background color

At this point a background color and border can be applied. There are many combinations of border and background colors that can be used.

create horizontal rollover list with css
create horizontal rollover list with css

CSS CODE

#topnav ul
{
margin: 0px;
padding: 0px;
list-style-type: none;
}
#topnav ul li
{
display: inline;
}
#topnav ul li a
{
text-decoration:none;
padding:1em 1em;
color:#fff;
background-color:#808000;

}

HTML CODE
<div id=”topnav">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Product</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">
Contact</a></li>
<li><a href="#">About</a></li>
</ul>
</div>

Step 8: Add a rollover color

Use “a:hover” to set a second background color, as a rollover. Roll over the list now you will see how it works.

CSS CODE

#topnav ul
{
margin: 0px;
padding: 0px;
list-style-type: none;
}
#topnav ul li
{
display: inline;
}
#topnav ul li a
{
text-decoration:none;
padding:1em 1em;
color:#fff;
background-color:#808000;
}
#topnav ul li a:hover
{
color: #fff;
background-color:#000000;
}

HTML CODE
<div id=”topnav">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Product</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">
Contact</a></li>
<li><a href="#">About</a></li>
</ul>
</div>

Step 9: Center the list

To center the list, add “text-align: center;” to the “UL”.

CSS CODE

#topnav ul
{
margin: 0px;
padding: 0px;
list-style-type: none;
text-align: center;
}
#topnav ul li
{
display: inline;
}
#topnav ul li a
{
text-decoration:none;
padding:1em 1em;
color:#fff;
background-color:#808000;
}
#topnav ul li a:hover
{
color: #fff;
background-color:#000000;
}

HTML CODE
<div id=”topnav">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Product</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">
Contact</a></li>
<li><a href="#">About</a></li>
</ul>
</div>

And you done it.

Thank you!