CreateaFreeWebsite  with Responsive Web Design

How to Create a Button in HTML

The navigational system of your website is one of its most important features.

You can use simple hyperlinks.

You can use fancy 'Navbars' built with Javascript.

You can use simple button images with your hyperlinks.

You can also create buttons using CSS and HTML5 code which mimic the mechanical aspects of Js navbars. And these won't slow your pages or create errors in browsers that don't support Js.

Most of the code is set up in the Style Sheets.

 

The Button

 

Button

 

The HTML

<p><a href="" class="button">Button</a></p>

You can set static widths or for liquid, adjust the percentage according to available space.

Us your imagination on the colors and shadow changes.

The CSS

a.button {
min-width: 20%;
text-align:center;
background-color: #ff9900;
box-shadow: -8px -8px 16px #990000 inset;
border: solid #990000 1px;
border-radius: 45px;
}

a.button {
font-family: arial;
font-weight: bold;
font-size: 16px;
color: #efefef;
text-decoration: none;
text-shadow: 1px 1px 1px #0e0e0e;
padding: 1% 2%;
margin: 0 0
}

a:hover.button {

background-color: #ffcc80;
text-decoration: none;
box-shadow: -4px -4px 10px #0e0e0e inset;
border: solid #0e0e0e 1px;
}

 

The Button2

 

Button

 

The HTML

<a href="" class="button2">Button 2</a>

You can set static widths or for liquid, adjust the percentage according to available space.

Us your imagination on the colors and shadow changes.

The CSS

a.button2 {
min-width: 20%;
background: #fefefe;
box-shadow: 4px 4px 8px #0e0e0e;
border: solid #0e0e0e 2px;
border-radius: 0;
}

a.button2 {
font-family: arial;
font-size: 16px;
text-align:center;
color: #0e0e0e;
text-shadow: none;
text-decoration:none;
padding: 1% 2%;
margin: 0 2%
}

a:hover.button2 {
color: #898989;
text-decoration: none;
box-shadow: 4px 4px 8px #0e0e0e inset;
border: solid #0e0e0e 1px;
border-radius: 0
}

 

We give you some basics here.

Got an imagination? See what you can do with CSS and your links.

 

Free Tools We Recommend

Free Ebook How to Code in HTML5 and CSS3
"How to Code in HTML5 and CSS3" is a free e-book about making websites in HTML5 and CSS for absolute beginners. It doesn't require any experience in IT to start....
FREE HTML Editor (Windows): NoteTab Light
All the features of a commercial HTML editor.
FREE Apache Server (Windows): IndigoAmpp
Set up a real time server environment right on your PC. Test forms and scripts before uploading to your web space.
Linux Users
If like us, you've left the insane world of Microsoft Windows for the even worse experience of Linux, we recommend the Geany Code Editor. You'll find it in your Linux Mint software repository. It's simple but powerful and FREE.
For image resizing we've found the easiest Linux tool to be Krita.