Showing posts with label Week6. Show all posts
Showing posts with label Week6. Show all posts

Monday, 1 September 2014

Project One: Useful code and tips

Just a recap of some useful tips and bits of code I have come across the past couple of weeks.

Styling your links and lists (useful for menu and sidebar links):

list-style-type: none;  (this gets rid of  the bullet points in your list)

Your links can be in different states as followed:
a:link; - this is the physical link as it first appears on the webpage.
a:visited; - This is how the link will appear once it has been visited.
a:hover; - This is the how the link will appear when you hover over it.
a:active; - This is how the link will appear while it is in use.

Underneath each of these commands you can style them by using the following code:
text-decoration: none; (gets rid of the underlining on the link).
color:#8D9195;  (changes the colour that the link will be).
background-color:#8D9195; (specifies the background colour of the link).

When setting the style for several link states, there are some rules to remember:
a:hover MUST come after a:link and a.visited.
a:active MUST come after a:hover.

Background-repeat property:

The background-repeat property sets if/how a background image will be repeated. By default, a background-image is repeated both vertically and horizontally. The following code can be used:
background-repeat: repeat-x; (the background will only be repeated horizontally).
background-repeat: repeat-y; (the background will only be repeated vertically).
background-repeat: no-repeat; (the background image will not be repeated).


I found that I had to use the background-repeat: no-repeat; in my redesign for the Evoke website because the main image on the home page kept repeating when i didn't want it to. 


Margins vs Padding:

Margins and Padding is something I keep getting confused. Here is a diagram to help explain the difference between the two.


This diagram is also known as the CSS Box Model.  The Box Model allows us to add a border around elements and to define space between elements. The 'content' is where text and images appear. The 'padding' clears an area around the content and is transparent. The 'border' is what gores around the 'padding' and 'content' and the 'margin' is what clears an area outside the border and is transparent also. 

For further explanation on the above tips you can go to these links:
http://www.w3schools.com/css/css_link.asp
http://www.yourhtmlsource.com/stylesheets/csstext.html
http://www.w3schools.com/cssref/pr_background-repeat.asp
http://www.w3schools.com/css/css_boxmodel.asp

Thursday, 28 August 2014

Project One: Redesigning Evoke website: Progress

Today I discovered that I wasn't closing off all my div's properly and so this was disrupting the design of the website. I have had to go back through my code and check that everything has a opening and closing tag. I managed to get this sorted and that seem to automatically fix some of the problems I was having with trying to get the footer in the center and other elements on the page.

I originally planned on using the font 'Arial' for the body of the text and 'Century' for the tabs and menu bars but I have ended up just using 'Arial' for everything. Something else I have realised is that when I was making the mock up in illustrator for the headings 'About Us' and '... Explorers and Dreamers ...' , I stretched out the headings so they looked narrower and of course I can't do that in the code that I am aware of. The headings have ended up looking abit different because of this.

I also have figured out why the main image kept repeating itself. By default the image will repeat so to stop this from happening you need to use the code "background-repeat: no-repeat;".

Here is some screen shots of the 'home' page and 'about' page finished. I have linked them together and most things on the pages have links and hovers.

'Home' Page:





'About' Page:



Some challenges I had along the way were the footer and trying to get everything it the correct position. I considered just making is simpler because it just wasn't going the way I wanted it to. I did get there in the end though. I also had trouble with the 'Find Shows' section on the home page. So I ended up simplifying that and just making it a list instead. Overall I think I have decided its best to stick to a simple layout for coding purposes especially if your still learning. 

A couple of things I would still like to do are:
- Add a third page
- Create hovers for the social media icons in the footer and search icon at the top.
- Create links for the 'Guest Collections' and 'Best of 2012' sections on the Homepage. 

Wednesday, 27 August 2014

Project One: CSS slicing and image optimisation

This week in class we covered CSS slicing and image optimisation. CSS slicing is the process of dividing up a design into different sections/slices which define how the webpage will be coded.  We have been doing this same process already in class by creating div maps in illustrator. Slicing basically is breaking down the design into smaller areas, allowing you to see which parts need to be nested inside one another, which parts need to be seperate, which parts that might be repeated (eg: header, menu, footer) and which parts are unique to each page (eg: the specific information).

The areas that are sliced become our divs for when we begin to code. This is worthwhile doing as it helps with site optimisation in terms of load time (no one likes a slow website). In most cases the more your page is broken down, the faster the page will load. It is a really good idea to keep elements that are common throughout your website common in CSS too as this will mean it will only need to load once. This is why you create a HTML and CSS template so that it can be used as the starting point for all your pages. To do this you need to copy your index.html file and then rename the copy your new page name for example aboutus.html. Check that they both still link to the same CSS file. In the menu add a link so that it will link to your second page. Use the code "h ref" to do this. You can then go and add any new code to your aboutus.html file that is specific to that page and then add the styles for that code to the CSS file. 

Tips: 
- when naming your files make sure there are no spaces,  they start with a lowercase letter, no numerals if possible and no punctuation unless its a hyphen. 
-  When writing additional CSS make sure and additions or changes don't effect you index.html file too. 
- If the selector only appears of the aboutus.html page then it should be fine to style individually.
- If the selector is used on multiple pages and you want to style it in different ways on each page, you will need to go back to you HTML and write new ID or class selectors to prevent clashes.

Another thing image optimisation is crucial for web design as you don't want your webpage to take a long time to load. You also want you photos to be good quality to though. It is finding the right balance between file size and picture quality. The bigger the images the longer they will take to load. A good way around this is displaying the image as a thumbnail or smaller size and then giving the viewer the option to open the image at full size in a new window if they want to. 

Here are a couple of useful websites I have found that give you tips and explain optimising images and search engine optimisation (SEO) in more detail.