background preloader

Clean and pure CSS FORM design

CSS Image Opacity / Transparency CSS3 Gradient Buttons Last week I talked about Cross-Browser CSS Gradient. Today I'm going to show you how to put the CSS gradient feature in a good practical use. Check out my demo to see a set of gradient buttons that I have created with just CSS (no image or Javascript). What Is So Cool About These Buttons? Pure CSS: no image or Javascript is used. Preview The image below shows how the button will display in different browsers. Button States normal state = gradient with border and shadow styles. hover = darker gradient active = gradient is reversed, 1px down, and darker font color as well. General Styles For The Button The following code is the general styles for the .button class. For more details on border-radius, text-shadow, and box-shadow, read my article The Basics of CSS3. Color Gradient Styles The code below is the CSS styling for the orange button. For more details on CSS gradient, read my article Cross-Browser CSS Gradient. How To Use My Buttons?

4 methods of adding CSS to HTML: link, embed, inline and import by Matthew James Taylor on 18 February 2009 There is more than one way to add a Cascading Style Sheet (CSS) to your HTML document. In this short tutorial I will explain the strengths and weaknesses of the four main methods. Linking to a separate CSS file This is the most common method of attaching CSS rules to an HTML document. Make sure you include the correct path to your CSS file in the href. There are many advantages to linking to a separate CSS file. Embedding CSS into the HTML You can also embed CSS rules directly into any HTML page. <style media="screen" type="text/css"> Add style rules here </style> All of your CSS rules go between the style tags. The disadvantage with this approach is the styles must be downloaded every time someone visits the page, this can cause a slightly slower browsing experience. Adding Inline CSS to HTML tags Style rules can also be added directly to any HTML element. <h2 style="color:red;background:black;">This is a red heading with a black background</h2>

How to create Tabs with CSS and jQuery from scratch Another feature that is often added to Web 2.0 sites is tabbed content. I'm not talking about tabbed navigation. Tabbed content is when different chunks of HTML are shown depending on what tab is clicked. If you don't know about jQuery yet, let me have the pleasure to introduce you to it. It's a very easy-to-use JavaScript library that offers easy DOM manipulation, effects and a ton more. Note: you can also use standard JavaScript or Prototype when doing this as well. Step 1. In this example, we are going to use the jQuery core library found here. Clear, Concise, and Entertaining Cover to Cover JavaScript: The Missing Manual — This book from bestselling author David McFarland teaches you how to use JavaScript in sophisticated ways -- even if you have little or no programming experience. Step 2. I'm going to create a file called myapp.html. Notice that at the top of the HTML page, we are including three files. Step 3. Let's create the CSS file that's included in the HTML above. Step 4.

CSS Tutorial How to Create a Drop-down Nav Menu With HTML5, CSS3 and JQuery In this tutorial, we’ll take a look and see what we can achieve with HTML5 and CSS3 when it comes to the staple of current web sites: the humble drop-down navigation menu. We’ll also use jQuery to handle the effects and add the finishing touches for us. HTML5 brings to the spec a dedicated <nav> element that should be used as the container for any major navigation structure, such as the main vertical or horizontal site navigation menus, or an in-page table of contents for example. IE unfortunately doesn’t support this new element yet, but there is a simple fix we can use, of which I’m sure you’re all aware. Using CSS3 we can do away with what would have required the use of several background images and possibly an additional wrapping container or two and rely (almost) purely on some of the new style properties, such as rounded corners and drop-shadows for example, that are available to supporting browsers. Step 1. Step 2. the Underlying Page Save this as nav.html in the nav folder.

How To Use CSS3 Media Queries To Create a Mobile Version of Your Website | Smashing Mobile Advertisement CSS3 continues to both excite and frustrate web designers and developers. We are excited about the possibilities that CSS3 brings, and the problems it will solve, but also frustrated by the lack of support in Internet Explorer 8. In this article I’ll explain how, with a few CSS rules, you can create an iPhone version of your site using CSS3, that will work now. Media Queries If you have ever created a print stylesheet for a website then you will be familiar with the idea of creating a specific stylesheet to come into play under certain conditions – in the case of a print stylesheet when the page is printed. The Media Queries in CSS3 take this idea and extend it. width and height (of the browser window)device width and heightorientation – for example is a phone in landscape or portrait mode? If the user has a browser that supports media queries then we can write CSS specifically for certain situations. The dConstruct 2010 website in Safari on a desktop computer Tidying up

How to Create Rounded Corners for Your Box Borders in CSS How to Use Border-Radius to Create Rounded or Curved Corners by Christopher Heng, thesitewizard.com If you were to create a rectangular box outline around the content on your web page using Cascading Style Sheets (CSS), the default is that your box borders will have pointed right-angled corners. Who is This Article For? This article is written for someone who knows how to work directly with HTML and CSS code. If you don't have a website, and are reading this article just to get the feel of things, it's best to start by reading How to Make / Create Your Own Website: The Beginner's A-Z Guide instead. Rounded Corners Using CSS 3's Border-Radius The CSS property for creating rounded corners is known as border-radius. Let's take a look at an example box using the border-radius property (below). Rounded Corners Using Purely Standards-Compliant CSS (Demo) This paragraph is enclosed in a box that uses the CSS3 border-radius property. Other types of curved corners are also possible. Conclusion

How to Design a Two Column Layout for Your Website Using CSS 2 Columns Using Float, with Optional Header and Footer by Christopher Heng, thesitewizard.com There are many ways to create a two column layout using Cascading Style Sheets (CSS). This article takes you through the steps of using one method. The code given here will also allow you to add an optional header and footer that spans both columns to your pages should you wish. Prerequisites For you to be able to use this article, you need to be able to code directly in both HTML and CSS. My tutorials for the free web editors KompoZer and Nvu may also be used to create 2 column sites, albeit not using CSS. Note that you do not have to be an expert in writing HTML or CSS code. Using Float to Define 2 Columns While there are many methods of using CSS to create a two-column site, this tutorial uses the float property to move one column to the side of another. Compatibility The two-column CSS given here has been tested to work on Internet Explorer 6 and 7, Firefox, Opera, and Safari. Conclusion

CSS Tutorial

Related: