Showing posts with label web design. Show all posts
Showing posts with label web design. Show all posts

Monday, May 30, 2016

Top 5 Web Design Tips

1.What's The Point?

What's the point of your website
What's the point of your website? That must be your first decision

Believe it or not there are only 3 types of websites - information, entertainment and transaction.

  • Information websites provide information- obvious example is Wikipedia
  • Entertainment website provide entertainment- obvious example is YouTube.
  • Transaction websites will either buy goods from you and/or sell goods to you - obvious example is eBay.

Every website falls into one or more of these categories. The first thing you need to decide before designing your website is what is  its purpose? Secondly who is it aimed at? Once you have made those decisions you can more easily design your website to meet the demands associated with that website category and that target audience.

2. Mobile Is Bigger Than Desktop*

Internet usage is now greatest on mobile device
Internet usage is now greatest on mobile device

It goes without saying nowadays that your website should be responsive but I have found that people tend to create the desktop design and then use media queries to work down to tablet device design and finally mobile design. This is the wrong approach. Why?

*For the first time more people now access the internet using mobile devices than desktops or tablets so it makes sense to prioritise your websites mobile design then scale up using a fluid design and/or media queries.


3. Show The Way

An organised, obvious and functional menu
An organised, obvious and functional menu is key to a successful website

Web navigation has many well established and functioning characteristics and you should not stray away from them,; there is no need to reinvent the wheel and if you try it will likely confuse your visitors and spoil their browsing experience. On the flip side, an effective navigation system encourages browsing within the website which can in turn increase revenue.

Your menu is obviously the main navigation device for your website and it should be immediately obvious when the webpage launches, ideally fixed at the top of the page with no surrounding elements to distract from it. This also makes the links easier to click on a mobile device. If the website's style allows it then perhaps add an additional (relevant) icon with each menu link, this creates an immediate association for the visitor with the purpose of the link.

Links within the body text should at least be a different colour than the body text and you should retain the default link underline as without it the links may just look like bold text. Ideally all links should have a hover effect added using CSS and a title attribute using HTML.



4. Nobody Reads

nobody reads text any more
If nobody reads text any more then how do you get your message across

Let's face facts, nobody reads all the text on a website, in fact I don't even know if anyone will read this sentence. What people do is scan the page for what they want, when they do this images, headings, sub-headings and links are what they notice (in that order).

Just checking if you are reading or scanning...

With this knowledge in mind you should provide images and/or icons to go with all key links/points and break any large areas of text into sections, each with a heading and possibly sub headings also like I have tried to do with this article. As a general rule in terms of website text, just get to the point.


5. Optimise, Optimise, Optimise**

website optimisation
There are 3 key areas of your website to be optimised

**I wasn't repeating the word optimise for fun or even for emphasis. I actually want to advise that you optimise 3 keys areas of your website: the layout, the loading speed and the content.

The layout optimisation should focus on utilising one of the recognised web layout techniques such as the F layout or the Z layout. The purpose of which is to direct visitors to the outcome that you want such as clicking on a link, signing up to a newsletter or buying a product. An optimal layout will result in optimal outcomes.

The loading speed can be optimised by removing unnecessary content, minifying you HTML and CSS, keeping slow loading content below the fold, optimising images for web viewing etc. Our tips to improve website loading speed and the Google page speed insights tool is a great help. Faster loading is not just appreciated by your visitors but also the search engines who now factor it into their indexing algorithms.

Optimising content is old news but remains an important activity which still makes lots of companies lots of money. The reality is that it is actually a relatively simple but highly tedious process, so if you got the time then you can save the money. Learn more about SEO here.

You may also be interested in the web design process and our 10 steps to designing and creating a website.


Wednesday, May 25, 2016

Create A Website In 10 Easy Steps

how to make a website
Creating a website is a complex process but like any process you just need to take it step by step

This article discusses the 10 steps involved in designing and creating a website. While the web design process is a more theory based guide to approaching a web design project, this 10 step guide is more practically focused. Even if you are a total beginner, web design novice or web design student you can use these steps to successfully create your own website.


1. What is the aim of the website..?

All websites can be allocated into just 3 types...

Information:  

These type of websites simply supply information on a specific topic or topics that they hope people will find useful, sometimes just a bio and contact information of a business. The information is usually provided for free (but not always) and you can then monitise the website  through placing ads. This website is an example of an information focused website.

Entertainment: 

These type of websites provide entertainment for the visitor usually through videos, music or games. YouTube a is a prime example of an entertainment focused website. The information is usually provided for free (but not always) and you can then monitise the website  through placing ads.

Transaction: 

The name says it all really! These websites allow you to buy and/or sell goods online. Amazon and eBay are probably the most well known buy & sell focused websites. These websites usually have little or no ads as they make their money from the sales. Any ads are often for their own products.

Once you recognise what the purpose of your website is you should research existing websites of the same type to see what the competition are doing. After your research decide what the key aim of the website is. This may be for the visitor to click on a specific link, to make a sale, to contact you etc. Whatever it is you need to decide. You can have more than one aim for your website but you should still specify the key aim.

2. Plan The Layout (based around the key aim)

Plan out your website's layout
The layout of your website will be key to directing the visitor towards the outcome you want to achieve.
Whatever the key aim you decided on in the previous step now is time to plan out how best to achieve it. This might be through make a certain element pop up, be larger than others, be strategically positioned or colored, be animated, be framed etc. It could even be through multiple methods. Whatever you decide, create a sketched layout to display where you intend to place the different elements of the website.

There are even web design theories on how best to achieve this. The F Layout and the Z Layout  and the Gutenberg Diagram are the 3 most common.

3. Select An Appropriate Style 

Once decided upon a strategic layout for your website and armed with a sketched layout to work from you will next need to decide on an appropriate style for the website. By style I am referring to the colors, fonts and imagery that will be used in the website. It is very important to select a style appropriate for the website and not one based on your favorite colors or fonts as these may not match well with the website's purpose.

Colors...

Creating a colour swatch like this makes designing the website easier
You should create a colour swatch for your website design project
  • Color emphasizes, highlights, and leads the eye to important points or links.
  • Colour identifies recurring themes (i.e. titles and subtitles are usually the same colours).
  • Conversely, colour can differentiate, such as different colours in pie charts and bar graphs.
  • Color symbolizes and triggers emotions and associations.
  • Create color schemes at www.paletton.com

Fonts...

Always use a minimum of 2 and a maximum of 3 fonts in your website
With so many fonts to choose from it can be hard to pick one

Legibility and readability refer to how easy a font is to see and also read as a block of text. Sans serif fonts are easy to read than serif fonts and mono-space are very legible but not very readable. For more about sans serif, serif and mono-space read this.

Appropriateness of fonts is similar to appropriateness of colors, choose a font based on it's suitability to the website and not based on your personal preferences. For free fonts go here.

Pairing fonts is a difficult business but in terms of websites the key tips are to never use more than 3 fonts (too cluttered) but never use less than 2 (too boring). Your body text should always be a relatively simple sans serif font while your headings can be any appropriate fonts once they are legible. For more advice on pairing fonts check out http://fontpair.co/

Font size is a very important aspect that must also be taken into consideration. When choosing a font size, one should keep in mind that choosing sizes closer to one another for various levels within your site will output a more professional and elegant webpage. 

Font emphasis is also an important factor as not only will font emphasis aid in search engine optimization, it also alerts viewers to what is important on a page or where the links are located. Search engine spiders look for phrases that are either in bold, highlighted or between header tags. These phrases are deemed as important. One can therefore control keywords by placing them in bold or italics.

TIP: Always use a minimum of 2 and a maximum of 3 fonts in your website

Images...

You should gather and optimize all your websites images first
There are now millions of free images available to web designers 

Professional: Don't even dream of using any out of focus, blurry or just generally amateur photos and don't get me started on clipart, suffice to say it's not a good idea. There are plenty of quality and free stock photos and graphics available online with the best FreeImage websites reviewed here.

Appropriate: As with the colors and fonts be sure to choose a photo based on it's suitability for the website not just because it is a "nice" photo. Also try to stay clear of the dull, lifeless stock photography which litters corporate websites the world over. The use of icons or graphics instead of photos is now a common practice and allows users to "read" the website more easily and quickly.

4. Gather and Create Website Content

File management is a key part of successful web development
A website is made up of a wide range of content types like text, images, videos and udio

This one is pretty self explanatory. Once you have decided on the style of the website design you want the next step is to get organised by finding or creating all the content you need. When I say content I am referring to text, images, video, audio, custom fonts, files for download etc.

As well as gathering and/or creating the content you will also need to Optimise the content in terms of file names and file types. The file type of audio and video in particular can effect is they will load on a particular browser and also how quickly they do load. Read more on that here. In general MP4 for video and MP3 for audio are your best options.

"An image tells a thousand words" or so they saying goes, however they are also big files which can be slow to load and therefore damage your websites' load speed and user friendliness. Softwares such as Photoshop have specific tools to optimise the size and file type of the image for you. Free Photoshop alternatives like Gimp and online editors such as Pixlr are also great options.

Depending on the method you choose for the actual creation of the website you may need to store content in order to link it from your website. For images Flickr or Picasa are best, YouTube or Vimeo for videos and Google Drive, One Drive or Drop Box for files.

5. Learn HTML and CSS (the basics at least)

Every web designer and developer should use HTML and CSS
HTML and CSS are the building blocks of all websites

Whatever method you choose to create a website through you will still need to know the basics of HTML and CSS in order to make the most of your website (No matter what you have been told!).

Even WYSIWYG website builders like Wix and Weebly (more on those in a moment) use HTML and CSS in the background and if you want to tweak the design or add custom widgets you will need to know basic HTML and CSS.

We have a nice and simple 10 step guide to learning HTML and another for CSS. You can also visit the W3Schools website for information on specific aspects of HTML or CSS.

6. Create the website (5 methods to choose from)

A website can be built a number of different ways
There are 5 main ways to create a website

So now that you have the basics of HTML and CSS it is time to create the actual website. It may seem silly to say this but if you have flicked through the article straight to this section I really recommend going back to the beginning! So many people jump straight in at this stage and waste a lot of their time because they have not completed the previous steps. Don't say you weren't warned.

With that little rant over, lets look at your options for creating the website.

Programmed from scratch: 

If you have good HTML and CSS skills or perhaps you are really enjoying the W3schools tutorials I recommended earlier then this is an option for you. It is also the most cost effective option but also the most time consuming. Komodo Edit is an excellent free code editor which you can use to make programming your own website a little easier.

Start with a template:

If you want to program the website yourself but need a little bit of a helping hand getting started then perhaps a website template is the way to go, just be sure to get a responsive template to ensure your website is as user friendly as possible. You can choose from an amazing 100 free responsive website templates here. A template is a great idea, especially for new web designers, just be sure to customise it!

Website builders:

Website builders advertise themselves as the easiest and quickest method to create a website. Companies like SquareSpace, Wix and Weebly are the best options for this approach and they both offer a starter package where you can get online with a free sub-domain name and free hosting. However, in my opinion, this is not a good option.

Website builders always seem to result in very rigid web designs, the free domain name is not a full domain and they tend to overcharge you for a full domain name. You often need to upgrade to a paid account to go to a custom domain too and the monthly or yearly pricing structure is usually quite expensive. Bandwidth restriction, custom ads and storage space are other things that often need to be paid to unlock. In summary, this wouldn't be a choice I'd recommend.

Content Management Systems: (Recommended Option)

CMS for short, content management systems are similar to, and often confused with, website builders. The difference being a CMS website design and structure is often created by a web designer first before being handed over to a client who only has access to a front end to make basic updates.

However, especially if you have learned some HTML and CSS, you can take charge and create the website design and structure yourself using systems like Blogger and Wordpress. Which one is better is constantly being debated online with my personal preference being Blogger (read why). Whichever you choose this is a great option which offers you templates to get started, widgets to drag and drop in while still having access to the HTML and CSS to make advanced or specific changes and tweaks.

Hire a web designer:

If you don't have the time to learn how to build a website, need to have complex functions or a very specific look... and you have a budget, then you will want to outsource the work.

Be careful who you hire, though. A poorly developed website can cost you money, drive away customers, and hurt your reputation. Following a few basic steps will increase your odds of hiring a creative, technically savvy, and cost-effective design firm or freelancer.

We can proudly recommend Opus Web Designs as an excellent option.

7. Purchase a Domain Name (and hosting)

A website needs a domain name so it can be found online
Select your domain name carefully
Depending on the method you chose to create the website you may also need hosting space for the website but all methods require teh purchase of a domain name. There a far too many domain name sellers to list and too many good ones to compare so what I generally advise is buy local.

Choose a company from your own country as if anything goes wrong you only need to make a local call instead of a national one and smaller companies can often deal with any issues you have more efficiently.

If you can afford it, I would also recommend purchasing a national and an international domain name extension to maximise the impact your website has in search engines in your own country.

8. Launch the website

Launching a website is only the beginning of the journey

Once the website is created and you have a place to put it and an address where people can go to view it then you are ready to go online. If you used a website builder or a CMS you may have already been online so there is not too much to say here.

Most web hosting platforms will have their own instructions and methods to upload the files to launch the website so I will not go into that either. I'll just say congratulations!

9. Perform SEO

SEO is an acronym for Search Engine Optimisation
Search Engine Optimisation is key to having a successful website

It may seem silly to be performing Search Engine Optimisation after you launch your website but realistically you need to anlayze your websites' online performance through Google's Search Console (webmaster tools) and Google Analytics before making any tweaks to your websites content.

SEO is a tedious task and requires attention to detail, a selecetive use of language and the optimistaion of all web content. You can read our top 10 SEO tips to help make it a little easier.

10. Market the website

Social networking tools are great for website marketing
"Build it and they will come" does not apply to websites! They must be marketed
Once SEO has been performed you should see an increase in traffic to your website but you will also need to market and promote the website through other methods to maintain and more importantly increase traffic.

The use of social media platforms is the most cost effective method of advertising your website to a large audience but don't try to use every single social media method as you simply won't have the time and an out of date or inactive account will only put people off. You will be better off choosing 3 or 4 methods and being as active as possible on those platforms to build your audience and keep them engaged. I would recommend Facebook, Twitter and then 1 or 2 others.

If you are regularly creating new content for your website, through a blog for example, then sending email newsletters is also a good way to remind people about your website and encourage them to return to access the new content. Mailchimp is definitely the market leader in this area.

Finally, you can always try to get other people to do it for you! By using share buttons or similar on your website you will encourage visitors to share your content with their contacts. It's a great method if it works but relies on you providing quality content otherwise it will not be shared. Addthis is an excellent option to easily integrate social sharing into your website.




How To Become A Web Designer

The role of the web designer
A web designer can take on various roles...

What is the job?

The role of the web designer, is to create the 'look and feel' of a website. What this actually involves can vary, depending on the size of team the designer is part of, or the type of company they are working for or where the designer is working alone or in a very small team. In smaller web design teams or when working as a freelance web designer, a web designer may need to take on additional roles such as programming and content writing, which are the work of the web developer and the content writer in larger web teams.

A web designer produces visuals of user interfaces, using software such as Adobe Photoshop or Illustrator. They usually follow a design brief that may be given as verbal instructions, a written specification or 'wire-frame' diagrams.

The designer will normally produce a separate visual for each type of screen within the product, for example the home page, first-level and lower-level pages of the website. As a minimum, these visuals must show the sites' layout, colour scheme, typography and any images or other features. However, they usually also specify, either through annotations or additional visuals, how interface elements should respond to interaction by visitors to the website. For example, this might include specifying colour or style changes for links that are clicked or rolled over, or designing animated buttons or menus.

Web Designers must prepare designs in a way that allows them to be easily implemented by developers programmers. This means designs must be appropriate for their intended purpose and visuals must be provided in the right format and at the correct size and resolution. Sometimes the roles are combined, with the designer-developer or designer-programmer being responsible for implementing their own designs, especially where the entire interface is animated or where a HTML and CSS based web design approach is being used.

Web Designers may be employed in permanent positions within a company, or may work on a freelance basis. Among freelancers, there tends to be most demand for those who are both good designers and have good all round technical expertise.

Info About Web Designers
Click to enlarge

Skills Needed:

If you want to become a web design the key skills that you will need include...

  • Good drawing and diagramming ability.
  • Knowledge of relevant design, image manipulation, and asset optimisation software.
  • Good interpersonal communication skills, especially when dealing with specialists in other disciplines.
  • Ability to manage time, prioritise tasks and work under pressure.
  • Knowledge of the requirements of the relevant Health and Safety legislation and procedures.


Typical career routes

The job tends to be divided into various levels of seniority, based mostly on experience. As a general rule, the greater the seniority, the more responsibility the designer will have for the overall user experience, including the design of navigation, features and functionality. At junior levels, Designers tend to be tasked with only some aspects, typically the visual styling, of the interface.

There are no typical career routes, but many web designers come from a traditional design background, such as graphic, print or information design. Sometimes they combine this with experience or study in a more technical subject, such as computer science, engineering, mathematics or psychology. It is this combination of creative and technical disciplines that tends to set the best web designers apart and enables them to progress into more senior positions.

Essential knowledge and skills

Simply put a web designer must know how to create a website, but this of course involves multiple parameters and requires a range of skills. Web designers need creativity and artistic flair but also a certain amount of technical understanding. The nature of web design means that they must often design within many unknown or variable parameters, for example, the user's screen size, or the amount of content to be included on a web page.

The web designer must therefore be able to identify these factors and think laterally so as to produce flexible designs that work correctly in a range of circumstances. They need to understand usability issues, the principles of interaction design, and any user-interface standards that are relevant to the website.

Training and qualifications

Although there are now various specialist web design courses available, many web designers' qualifications are in more traditional art-related subjects. Architecture and product design are particularly useful backgrounds, as they tend to encourage the combinations of creative and technical thinking that web design requires, design in its broadest sense. Experience is generally valued most, however, and a good portfolio of web design work is essential.

*If you enjoyed this article you may also find our Web Design Process and How To Create a Website articles useful.

10 Reasons Why You Should Use Blogger To Create Your Website

Blogger is an excellent resource for creating websites

Blogger is for creating blogs not websites, right...? Wrong! Although it may have started out that way, in fact it definitely started out that way, Blogger is now an extremely effective tool to easily and freely create full blown websites. If you don't believe me look at this website ,for example, which was created using Blogger - you wouldn't think it, would you! Even the website you are on now is a Blogger hosted website.

Like WordPress (but better IMHO) it is also an excellent Content Management System (CMS) tool which is just one of the many reasons why web designers should be using it. Unlike WordPress it is totally free with no hosting costs and a free sub-domain name given, there is also no charges or fees for using plugins or connecting to a custom domain. I use it regularly and there are really very few situations where it is not capable of meeting the needs of a client and more often than not it is a better, or at least simpler, option for both me and the client. So before I give away everything in the introduction and here's 10 reasons why Blogger is great for creating websites.

Blogger Is Free

It's free, totally free, ad free, no hosting cost, free sub-domain name provided and is therefore cheaper than everything else. The sub-domain name provided will be yourwebsite.blogspot.com which is fine for a blog but for a professional website it doesn't quite cut it right? Well that brings me to my next point...

Easy Custom Domain Integration

You cannot purchase a domain name directly through Blogger but you can connect your Blogger website with any domain name in a few simple steps, Blogger are even kind enough to provide you with instructions. The old .blogspot address will also redirect to the new domain with the content from your blogger website being displayed under your chosen domain without a visitor being any the wiser. Search engines will use the custom domain name to index the site, meaning it appears as a fully fledged professional website and not a run of the mill blog.

Although domain names are generally quite cheap, as low as $5 for an annual .com license, hosting on the other hand is not as cheap. I have seen hosting costs range anywhere from $50 to $500 a year depending on the amount of space, level of security and other features that a client can require. Blogger, as already mentioned, has no hosting costs. Where's the catch you ask? 

Free Unlimited Hosting

Well, one that used to stop me from using Blogger was that it does not support PHP. But nowadays for contact forms and other standard PHP things there are ways around it such as using JotForm to create and host your form, then embedding it into your Blogger site. Another big one that used to be a problem was that there used to be a limit of 20 static pages per site, but that has since been removed, so there is now unlimited space available which most paid hosting services can't offer. How is this possible you ask, well that brings us nicely to the next point.

It is Run By Google

Blogger is part of the Google family so you are guaranteed a quality and reliable service. But returning to the previous point about storage what a Blogger account also gives you is a Google account and with that comes lots of other free stuff. You see when you set up your blog you will need to create an account, which is actually a Google account (unless you already had one of course) and therefore you simultaneously set up a YouTube account, a Google Drive account, a Google + account, a Gmail account, a Google Calendar account, a Google Places account and much more besides. All of these tools can be used to expand the possibilities for your Blogger website like storing documents (Google Drive), hosting videos (YouTube), arranging or displaying events (Google Calendar) or literally putting your business on the map (Google Maps).

Easy SEO

(SEO is Search Engine Optimisation ) Within Blogger you can also label your blog posts with keywords and submit a specific description to be used by search engines while indexing your website. As a Google product it is also very well coded and hosted on a Google owned server so speed performance is usually very good. As mentioned above a Blogger account comes hand in hand with a Google account and 2 more SEO related tools called Google Webmaster and Google Analytics. Google webmaster allows you to index your Blogger website in the Google search listings and then control various aspects of that listing such as geographic targeting, robots.txt and sitemap.xml settings all the while receiving basic data about your websites performance. Google analytics takes performance data to the next level and allows you to monitor every conceivable detail about your websites performance.


Easy To Learn & Use

Blogger is genuinely very easy to learn and easy to use. It took me about 30 mins to get up to speed with all the main features of Blogger and I honestly could not say the same for WordPress, although that may say more about me as WordPress isn't popular for no reason. But I'm entitled to my opinion, and my opinion is that Blogger is easier to use than WordPress. There are also a wide selection of templates built in to help get you started as well as thousands available for free online from very talented and generous web designers. The layout is clean and simple with the ability to drag and drop the default sections around as well as the numerous widgets which can then be added to personalise your website.

Loads Of Gadgets

There are a wide selection of gadgets within Blogger that can be added to the default header, body, footer sections. Things like site search, follow by e-mail and Ad-sense can simply be selected, edited to suit your needs and then dragged and dropped into the site layout as you see fit. As well as these relatively standard gadgets there is one gadget simply called the HTML/JavaScript Gadget. If you are a web designer or coder and feel restricted by all the templates and standard gadgets this simply allows you to code anything at all to appear in your website. I use it mainly for slideshows and custom menus. Currently there are around 1,000 widgets/gadgets to choose from so there is plenty of choice.

More Than Just Templates

The 'customise' section within Blogger allows you to customise all the default elements of your website, on desktop or mobile, using a WYSIWYG system so even without any coding knowledge you can still personalise your website to the way you want it. As I touched on in the previous point if you don't like templates and standard web gadgets you can still edit the site H.T.M.L. and C.S.S. code of your Blogger website directly to create a unique and original design or just to tweak an existing template or gadget. Within the HTML code there are even 'conditional' sections such as (without the HTML to avoid confusion), if displaying on a mobile device then do x, y and z. This makes it really easy to customise the look of the mobile site option, which I just realised I forgot to mention as another great built in feature of Blogger websites!

Can Be Used As A CMS

This point is really only relevant for web designers/developers. For me and any web designer who already knows how to code a website from scratch anyway one would think that Blogger did not hold much appeal, however the fact is that a Blogger website is easy for a client to update the pages after you have designed them and therefore lends itself very well to being used as a Content Management System. A client simply needs to log into a Google account connected, through the blog's settings, to the website and on each page of the website they will then see little wrench icons at the bottom of each section. They can then click on the icon and use the pop up editor to make the changes they need. The editor is very similar to editing a word document as well as allowing the insertion of videos, images and links with relative ease. So if the client has basic computer skills then they should be fine. It can;t get much simpler than that! And if a client is a little more tech savvy then they can just used the Blogger system directly to edit the website in the same way that you set it up. 


*If you skimmed through and noticed only 9 headings you'll have to read through to discover the hidden 10th reason included in one of the sections - I say hidden but I only remember it as I was writing the article ;)

Tuesday, March 22, 2016

CSS Positioning and Layering

CSS Positioning
CSS positioning is a lot more advanced than just top, middle or bottom!

CSS Positioning

With CSS positioning, you can place an element exactly where you want it on your page. Together with floats, positioning gives you many possibilities to create an advanced and precise layout. To help us understand imagine a browser window as a system of coordinates, as in the image below.

Browser window screen coordinates for use with CSS Positioning
Browser window screen coordinates for use with CSS Positioning

The principle behind CSS positioning is that you can position any box anywhere in the system of coordinates. Let's say we want to position a headline. By using the box model we can make a headline appear as follows...


If we want this headline positioned 100px from the top of the document and 200px from the left of the document, we could type the following in our CSS:



The result will be as follows...

CSS Positioning
CSS Positioning

As you can see, positioning with CSS is a very precise technique to place elements.

Note: The element is positioned from its top left corner.

Absolute or Relative Positioning

There are two types of positioning, absolute and relative. In the sample above we used absolute positioning . An element which is positioned absolute does not obtain any space in the document, which means that it does not leave an empty space after being positioned. To position an element absolutely, the position property is set as absolute. You can subsequently use the properties left, right, top, and bottom to place the box. As an example of absolute positioning, the CSS code below would place 4 boxes in each corner of the browser window.



The difference between absolute and relative positioning is that for an element which is relatively positioned the position is calculated from the original position of the element in the document.

To position an element relatively, the property position is set as relative. That means that you move the element to the right, left, up or down. This way, the element still obtains a space in the document after it is positioned. An example code is shown below...



Tip: When using positioning it is recommended that you use either all absolute positioning or all relative positioning, mixing the two types can lead to problems, especially when the page is being viewed in different browsers. In my opinion it is best to use relative positioning, but don't just trust me try it out for yourself.

CSS layering with z-index

CSS operates in three dimensions, height, width and depth. In this lesson, we will learn how to let different elements become layers. This means we will be able to let elements overlap one another. To do that, you can assign each element a number using the CSS property z-index. The element with a higher number overlaps on top of an element with a lower number. Let us say we are playing poker and have a royal flush. Our hand can be presented in a way where each card has got a z-index:



The CSS code in the  example above would result in something like this...

CSS layering with z-index
CSS layering with z-index

The method is relatively simple but the possibilities are numerous. You can place text over images or text above text etc. Try it yourself to create effects in headlines or banners.

Next Up

Our ten steps to learning CSS has come to an end but we have a treat in store will a selection of CSS resources just for you coming soon. (sign up to our newsletter to be first to hear about their release)

http://www.onlinedesignteacher.com/2016/03/css-positioning-and-layering.html

CSS Floating

CSS Floating
The basic principles of CSS floating are displayed in this simple diagram

Floating elements with CSS

Any HTML element or <div> block can be floated to the right or to left by using the property float. That is to say that the <div> block or element, including its contents, either floats to the right or to the left in a document (or another containing box). The content which follows will fill the gap left behind. Float can be set as either left, right or none. The following figure illustrates the general principle in a little more detail than the on above.

CSS Float
CSS float in action

If, for example, we would like to have text wrapping around a picture we could float the image to the left and the following content would fill the gap (thus wrapping around it). The result would be like this...

Floating elements with CSS
CSS float example

The HTML code for the example above, look as follows:



To get the picture floating to the left and the text to surround it, you only have to define the width of the box which surrounds the picture, so none of the image is cut off, and then set the property float to left:



Floats can also be used to create columns in a document. To create two columns, you simply have to structure the desired columns in the HTML code with <div> as follows.



Now the desired width of the columns is set to 50%, and then you simply float each column to the left by defining the property float. Try it out for yourself.




Clear (Stop filling after floating)

The clear property is used to control how the elements following floated elements in a document behave. By default, the subsequent elements are moved up to fill the available space which will be freed up when a box is floated to the side. The property clear can assume the values left, right, both or none. The principle is, if clear, is set to both for a box, the top margin border of this box will always be under the lower margin border for possible floating boxes coming from above. In other words, it won't fill the gap left behind.




To avoid the text from floating up to fill the gap and sit next to the picture, we can add the following CSS, Try it out for yourself.



Next Up

Floats are useful in many situations and will often be used together with positioning. In the next section we will take a closer look at how to position html elements using CSS. There are two main types of positioning, relative and absolute, both are explained.



CSS Padding, Borders and Margin

CSS Padding, Borders and Margin
CSS Padding, Borders and Margin

Margin and Padding:

Now let's look at how you can use your knowledge of the box model to change the presentation of elements by setting the margin and padding properties as shown in the above example.

An element has four sides: right, left, top and bottom. 
The margin is the distance from each side to the neighbouring element or the outer borders of the document. As the first example, we will look at how you define margins for the document itself i.e. for the element <body>. The illustration below shows how we want the margins in our pages to be.

CSS Margins
CSS Margins

The CSS code for the above page would look like this,




Or, like background and font, you could compile the CSS code using just margin. Margin recognises the values in the order top, right, bottom, left.



You can set the margins in the same way on almost every element. For example, we can choose to define margins for all of our text paragraphs marked with <p>:



Padding can also be understood as 'filling'. This makes sense as padding does not directly affect the distance of the element to other elements but rather defines the inner distance between the border and the content of the element.

The usage of padding can be illustrated by looking at a simple example where all headlines have background colours. By defining padding for the headlines, you change how much filling there will be around the text in each headline. Try out the code below yourself and see what it looks like.



Borders

Borders can be used for many things, for example as a decorative element or to underline a separation of two things. CSS gives you endless options when using borders in your pages.

border-color

The width of borders is defined by the property border-width, which can obtain the values thin, medium, and thick, or a numeric value, indicated in pixels. The image below illustrates the system.

CSS Borders
CSS Borders

border-color

The property border-color defines which colour the border has. The values are the same as with the normal color-values for example "#123456", "rgb(123,123,123)" or "yellow".


border-style

The property border-style defines which type of border the element has. There are numerous different types of borders to choose from. Below 8 different types of borders are demonstrated, all the examples are shown with the colour "gold" and the thickness "thick" but can be shown in other colours and thicknesses.

CSS Border Styles
CSS Border Styles

CSS Border Samples

Let's look at some sample CSS codes, try these out yourself to see how they look.




It is also possible to state special properties for the top, bottom, right or left borders. The following example shows you how:



As is the case with many other properties, you can compile many properties into one using border. Let us take a look at an example:



Can be compiled into:



Next Up

In the next lesson we will learn how to float html elements using CSS.



CSS Box Model

The CSS Box Model
The CSS Box Model

The CSS Box Model

The box model in CSS describes the boxes which are automatically generated for all HTML-elements and which you can control using CSS. The box model contains detailed options regarding adjusting margin, border, padding and content for each element. The diagram below shows how the box model is constructed. The illustration above is purely theoretical, so let's try to put this new information into practice.



By utilising our knowledge of the box model and adding some CSS (examples to follow) to the previous HTML the example could be presented as follows...

CSS Box Model Example


The image below shows how each HTML element is surrounded by boxes which we can adjust using CSS.

CSS Box Model Example
The numbers around the areas are the margin and padding values

Height and Width

The height and width of each element or 'box', as represented by the box model can also be edited using CSS. In this section, we will take a look at how you easily can define the height and width of an element. With the width-property, you can define a certain width of an element. The example below sets the width of a <div> with a class value of 'box' to 200px.



In the example above as we did not specify a height, the height of the box will be set by the content of the box. You can of course set the height of an element with the property height if you wish.

As an example let us try to make the box in the previous example 500px high:



Tip: If you set the height or width to a value too small the content may prevent the code from working or in other cases some of the content will disappear. To ensure neither of these thing happen use the code overflow:auto. This will create a scroll bar on the right side of the div block so you can scroll up or down to view the content while still retaining the height and width you set. See the example below.

Next Up

In the next lesson we will look at examples for the padding, border and margin that we have identified as part of the box Model.


CSS Class and Id

CSS Class and Id with div and span
class and id work together with div and span to help you make the most of your CSS

This section on CSS actually focuses on the use of HTML attributes 'class' and 'id' and the HTML elements <div> and <span>. These are very important if you are to use CSS effectively as they hold the key to giving you complete control over every aspect of your website.

Class

Sometimes you want to apply a special style to a particular element or a particular group of elements and yet not every single element of that type! Confused? Don't be. Let's say that we have two lists of links to different grapes used for white wine and red wine. The HTML code could look like this:



What if we want the white wine links to be yellow, the red wine links to be red and the rest of the existing links on the webpage to stay blue? To achieve this, we first need to divide the links into two categories using the HTML attribute 'class'.

So we assign a class to each link using the HTML attribute class. We use class instead of id as class is used for multiple or group effects while id is used for single or individual effects. Let us try to specify some HTML classes from the example above:





We can then define special properties for links belonging to white wine and red wine, respectively by using .classname after the element it was used on (in this case 'a') in the style sheet of the document.



The above CSS code combined with the HTML shown earlier will result in the following...

This is a normal link

Grapes for white wine:

Grapes for white wine:

Id

In addition to grouping elements with class, you might need to identify one unique element. This is done by using the attribute id. What is special about the attribute id is that there cannot be two elements in the same document with the same id. Each id has to be unique. Now, let us take a look at an example of a possible usage of id:



The above could be headings of any document split into chapters or paragraphs. It would be natural to assign an id to each chapter as follows:



Let us say that the headline for chapter 1.1 must be in red. As shown in the example below you must define the properties in a specific element by using #id in the stylesheet of the document.



The above CSS combined with the previous HTML would result in something like the following...

Chapter 1

Chapter 1.1

Chapter 2

Chapter 2.1


Div and Span

The HTML elements <span> and <div> are used to group and structure a document and are usually used together with the attributes class and id. The difference between div and span is that <span> is used within an element (inline) while <div> is used to group one or more elements (block-level).

Span

In My Honest Opinion, <span> is not the most useful of elements as it is only used inline so it is often easier to use basic HTML code to format the part of the element (usually text within a paragraph) that you want to edit. However, with my little rant over, let's look at an example of <span> in use. Let's take a famous Benjamin Franklin phrase.



Let's say we want what Mr Franklin sees as the benefits of not sleeping your day away emphasized in red. For that purpose, we can mark the benefits with <span>. Each span is then added a class, which we can define in our style sheet:



In order to make those tagged words red then the CSS code would simply be...



The result would be....

Early to bed and early to rise makes a man healthy, wealthy and wise.

As mentioned earlier this is a bit long-winded for something that could have been done using the HTML <font color='red'>. Anyway not to worry, as you probably won't be using <span> too often. One element you definitely will be using though is <div>, so let's look at how it is used.

Div

As mentioned earlier while <span> is used within a block-level element, <div> is used to group one or more block-level elements. Aside from this difference, the grouping with <div> works in the same way. Let us take a look at an example with two lists of relatively recent U.S. presidents divided into their political affiliations:





And in our style sheet, we can utilize the grouping in the exact same way as above:



The above CSS code combined with the previous HTML would result in something like this...

  • John F. Kennedy
  • Lyndon B. Johnson
  • Jimmy Carter
  • Bill Clinton
  • Barack Obama

  • Richard Nixon
  • Gerald Ford
  • Ronald Reagan
  • George Bush
  • George W. Bush

These examples for <div> and <span> are very basic and are only intended to show you how to link the HTML elements with the associated CSS code. We will now look at the 'box model' which, when used with <div> and <span> and class and id, will really open up your design and layout possibilities with CSS.

Next Up

In the next lesson we look at the CSS Box Model which explains the details of how each HTML element is structures.



close
Banner iklan disini