background preloader

Css

Facebook Twitter

Selectors

Liquid. Print. Pure CSS: Remove Link Properties for Linked Images with Borders. There are many ways to style images with CSS. You can add borders: ..padding and margins: ..and even background graphics: You can also use images as links to other images: If so, you will probably want to style your links: But wait! Yeah, right. Unfortunately, CSS doesn’t accommodate qualified selectors.

Until this becomes a reality (*cough*), we must seek an alternate solution. This method certainly does the job, removing text and border properties from all classed image links without affecting the image styles themselves. Fortunately, CSS3 provides another way of targeting specific types of links via pattern matching and the attribute selector.

In these examples, the attribute selector is targeting specific attribute values; however, with the pattern-matching capabilities of the attribute selector, we can target any of the following elemental scenarios: ..which effectively neutralizes borders and underlines from the linked images. ..or even: Image captions on Web pages - HTML and CSS techniques. This document suggests three ways of presenting an image with a caption in HTML. Styling in CSS is also discussed. Summary: three methods Sadly enough, there is no markup for image captions in HTML, unless you count the figcaption element in HTML5 proposals. What comes closest to semantically associating some text content with some image is putting them into a table so that the image is in one cell and the text is either in another cell or in a caption element.

Then there’s the “semantically empty” approach, which is better than semantically wrong (such as suggestions to use definition list markup). There are two basic ways to use a table for an image and its caption, so as a whole, we have three alternative methods: a table with the image in one cell and the caption in another cell under it a table with the image in its only cell and the caption as the table caption (caption) element a div element containing both the image and an inner div element, which contains the caption A Dalmatian. How to Centre a DIV Block Using CSS. Standard Trick to Centering a Block of Text/Images Using Cascading Style Sheets by Christopher Heng, thesitewizard.com This article shows you how to centre (or "center" in US English) a DIV block, whether it contains text, graphics, or a mixture of both, using standards-compliant Cascading Style Sheets (CSS). The technique is useful not just for creating pleasing designs, but also for times when you want to create a fixed width single column layout with the main content placed in the centre of the page, and not flushed to one side.

Assumptions I will assume in this article that you have some basic knowledge of how to write HTML and CSS. If you don't even have a website yet, and have arrived at this article looking for tips on designing one, please start with my article on How to Start/Create Your Own Website instead. Steps to Centering a DIV Block without Centering the Text Inside Let's assume that you have a div block as follows: <div id="content"> This is a DIV block that is to be centred. Tutorials: CSS Link Styles. Want to know how to create CSS link styles (pseudoclasses)?

It's easy! Just follow along and you'll be a master in no time. link style syntax Default link styles look like this in a style sheet: A Style, in CSS jargon, is called a Rule. The first part of the Rule (a:link)is called the Selector. The curly bracket pair contains the Declaration, which is comprised of a Property (color) and a Value (#333333). The Selector a:link can roughly be translated to mean: Mr. Why don't we set the font family?

Notice that our 4 link styles (link, visited, hover, and active) declare neither font-family nor font-size. So, if the link is in a paragraph, it will inherit its font and size from that paragraph. what is a link... really. Links are links because they are wrapped inside anchor <a> tags: This sentence, containing this link to thislink.htm looks like this in the source code: Notice that the actual hyperlinked words —this link— are contained between an opening <a> tag and a closing </a> tag. A:link. Meyerweb.com. 50 Useful Coding Techniques (CSS Layouts, Visual Effects and Forms) - Smashing Magazine. Advertisement Although CSS is generally considered a simple and straightforward language, sometimes it requires creativity, skill and a bit of experimentation. The good news is that designers and developers worldwide often face similar problems and choose to share their insights and workarounds with the wider community.

This is where we come in. We are always looking to collect such articles for our posts so that we can deliver the most useful and relevant content to our readers. In this post, we present an overview of useful CSS/jQuery coding tips, tricks and techniques for visual effects, layouts and web form design to help you find solutions to the problems you are dealing with or will have to deal with in future. You may want to look at similar CSS-related posts that we published last months: CSS Layouts: Techniques And Workarounds Facebook Style Footer Admin Panel4Learn how to re-create the Facebook footer admin panel with CSS and jQuery.

Adaptable View: How Do They Do It? Equal Height Columns with Cross-Browser CSS and No Hacks. By Matthew James Taylor on 17 October 2008 Creating equal height columns with CSS is not as easy as it may first seem. This tutorial highlights the display problems that occur with multiple column layouts, and then shows a simple solution that works in all common web browsers. The method shown here is 100% CSS hack-free, image-free and JavaScript-free so it can even be used on the most strictly coded websites. For those who want some action immediately check out my demo pages: 2 column, 3 column, 4 column and 5 column. Also see my Perfect multi-column CSS liquid layouts - these use the same equal height column CSS principles as discussed below. The problem with equal height columns In the example above we have three columns each with a different amount of content.

Separating the column content from it's background colour The first step to solving the equal height problem is to break it into smaller pieces that can be solved separately. Three column HTML div structure Three column CSS. Applying border &amp; opacity to images onMouseover in CSS. Applying border & opacity to images onMouseover in CSS In this tutorial, I'll show you how to use CSS alone to reproduce two popular image effects that have traditionally been done using scripting. The advantage of looking to CSS instead is obvious- much more lightweight and easier to implement. The two effects in question are: For cross browser compatibility (IE5+, FF1+), the image needs to be hyperlinked in order for the CSS to work, as IE (as of IE6) only supports the ":hover" pseudo class on A elements.

Lets now look at the CSS code for each of the two effects separately. Applying border onMouseover to images First up, the CSS technique for applying a border to image links onMouseover: By using the CSS pseudo class ":hover", we apply the enclosed CSS definitions to only when the mouse moves over any image with class="borderit". Applying opacity onMouseover to images Moving on, here's the CSS code for manipulating an image's opacity onMouseover: CSS Examples. CSS-Tricks. Assigning property values, Cascading, and Inheritance. 6.1 Specified, computed, and actual values Once a user agent has parsed a document and constructed a document tree, it must assign, for every element in the tree, a value to every property that applies to the target media type. The final value of a property is the result of a four-step calculation: the value is determined through specification (the "specified value"), then resolved into a value that is used for inheritance (the "computed value"), then converted into an absolute value if necessary (the "used value"), and finally transformed according to the limitations of the local environment (the "actual value"). 6.1.1 Specified values User agents must first assign a specified value to each property based on the following mechanisms (in order of precedence): If the cascade results in a value, use it.

Otherwise, if the property is inherited and the element is not the root of the document tree, use the computed value of the parent element. 6.1.2 Computed values 6.1.3 Used values used value The. Link Specificity. Last modified Wednesday 13 February 2008 21:52:06 UTC Q: I tried to apply CSS to my hyperlinks and the hovering didn't work.

How come? Is this another case of browsers being stupid? A: While it's always possible that you have a stupid browser-- that's not really for me to say-- it is more often the case that the styles have simply been written in the wrong order. To ensure that you see your various link styles, you're best off putting your styles in the order "link-visited-hover-active", or "LVHA" for short. If you're concerned about focus styles, they may go at the end-- but wait until you've read this explanation before you decide. The core of the situation is this: every selector has a specificity. So any paragraph which has a class of hithere will be green, not red.

Aside: this only comes into play when the same property is involved. All paragraphs will be in Courier, but those with a class of hithere will be in Courier and green in color. A:link A:visited A:hover A:active. What is Liquid Design? [Design Practice] The Internet is still in its infancy as a medium but, slowly — very slowly — designers are coming to terms with it. Well, a small contingency of designers anyway. The sad fact is that the vast majority of Websites you’ll come across, especially small-medium sized business sites, would be better off being made into a print brochure. You know what I mean: A 720×400 pixel "window" sitting in the middle of the monitor looking lonely and unloved. Possibly sporting "chunky buttons" "flashing knobs" and the legendary "Spinning Logo".

This article will introduce you to the basic concepts of creating a fluid Web page layout with CSS, and withTables. The Web is Not Print People who find themselves faced with the task of creating or commissioning a Website tend to think in terms of print. Your visitors can use almost anything to access your information, from simple variations on popular themes such as: …to the more extreme ends of the spectrum such as: What is Liquid Design? Enough With The Theory! <! 5 Ways to Instantly Write Better CSS - NETTUTS. Intricate Fluid Layouts in Three Easy Steps. The Year of the Script may have drawn attention away from CSS but building fluid, multi-column, cross-browser CSS layouts can still be as unpleasant as a lump of coal. Read on for a worry-free approach in three quick steps. The layout system I developed, YUI Grids CSS, has three components. They can be used together as we’ll see, or independently.

The Three Easy Steps Choose fluid or fixed layout, and choose the width (in percents or pixels) of the page. Choose the size, orientation, and source-order of the main and secondary blocks of content. Choose the number of columns and how they distribute (for example 50%-50% or 25%-75%), using stackable and nestable grid structures. The Setup There are two prerequisites: We need to normalize the size of an em and opt into the browser rendering engine’s Strict Mode. Ems are a superior unit of measure for our case because they represent the current font size and grow as the user increases their font size setting. Including the CSS Example: The Setup. 10 Challenging But Awesome CSS Techniques - NETTUTS. 10 Principles of the CSS Masters - NETTUTS. The CSS Tinderbox - Open Source Web Design Templates. WordPress Tinder A small collection of very simple WordPress template frames that can be easily customized and adpated to suit your needs.

They’re built for WordPress 3.8 or later and set up to use widgets in multiple locations. CSST Simple Orange Another three column design but with the “heavy” column to the left and the other two narrow columns on the right. If orange is your thing, check it out. Screenshot / Download Zip CSST Simple Red To be totally honest, this one looks a hell of a lot like Simple Orange but with a cherry flavor though. Screenshot / Download Zip Installing A Template To install one of these WordPress templates: 1. 2. 3. As with any WordPress template, you’ll more than likely need to adjust the styles a bit to mesh with your current settings.

(NOTE: Web geek tested and approved in Firefox 3.0 (Win), Firefox 2.0 (Mac), IE7 (Win), Opera 9.6 (Win), Safari 3.2 (Mac). Fixed-Width Templates Centered Box 1-Column 1-Column (2) 3-Over-4 Columns 3-Column 4-Column Now we’re talking! 2-Column. List-O-Matic - Generate CSS-styled navigation menus based on list items (using &lt;li&gt; tags) | Developer Tools. Css Zen Garden: The Beauty in CSS Design. Dynamic Drive CSS Library- Practical CSS codes and examples. CSS Remix: CSS-Based Website Gallery. Clean CSS - A Resource for Web Designers - Optmize and Format your CSS. CSS Basics - Making Cascading Style Sheets Easy to Understand.