background preloader

HTML and CSS

Facebook Twitter

Website backgrounds, templates and patterns

W3Schools. The W3C Markup Validation Service. Learn CSS Positioning in Ten Steps. 1. position:static The default positioning for all elements is position:static, which means the element is not positioned and occurs where it normally would in the document.

Learn CSS Positioning in Ten Steps

Normally you wouldn't specify this unless you needed to override a positioning that had been previously set. 2. position:relative If you specify position:relative, then you can use top or bottom, and left or right to move the element relative to where it would normally occur in the document. Let's move div-1 down 20 pixels, and to the left 40 pixels: Notice the space where div-1 normally would have been if we had not moved it: now it is an empty space. It appears that position:relative is not very useful, but it will perform an important task later in this tutorial. 3. position:absolute When you specify position:absolute, the element is removed from the document and placed exactly where you tell it to go. Let's move div-1a to the top right of the page: What I really want is to position div-1a relative to div-1. Footnotes 10. Smashing Coding. Category: Coding This extended category features articles on client-side and server-side programming languages, tools, frameworks and libraries, as well as back-end issues.

Smashing Coding

Experts and professionals reveal their coding tips, tricks and ideas. Curated by Dudley Storey and Rey Bango.. Popular tags in this category: JavaScript AI For An HTML Sliding Tiles Puzzle Sam Loyd (1841–1911), American chess player and puzzle maker, created the sliding tiles puzzle in the 1870s. The purpose of the puzzle is to rearrange the initial configuration of the tiles to match another configuration known as the goal configuration. Read more... Writing Next Generation Reusable JavaScript Modules in ECMAScript 6 Are you excited to take advantage of new JavaScript language features but not sure where to start, or how?

Read more... Making A Service Worker: A Case Study There’s no shortage of boosterism or excitement about the fledgling service worker API, now shipping in some popular browsers. Read more... Read more... Starting with HTML + CSS. This short tutorial is meant for people who want to start using CSS and have never written a CSS style sheet before. It does not explain much of CSS. It just explains how to create an HTML file, a CSS file and how to make them work together. After that, you can read any of a number of other tutorials to add more features to the HTML and CSS files. Or you can switch to using a dedicated HTML or CSS editor, that helps you set up complex sites. At the end of the tutorial, you will have made an HTML file that looks like this: The resulting HTML page, with colors and layout, all done with CSS.

Note that I don't claim that this is beautiful ☺ Sections that look like this are optional. Step 1: writing the HTML For this tutorial, I suggest you use only the very simplest of tools. Don't use a wordprocessor, such as Microsoft Word or OpenOffice. Step 1 is to open your text editor (Notepad, TextEdit, KEdit, or whatever is your favorite), start with an empty window and type the following: <!

Web Developer.