Presentation is loading. Please wait.

Presentation is loading. Please wait.

End User Computing More on HTML and CSS Sujana Jyothi Department of Computer Science

Similar presentations


Presentation on theme: "End User Computing More on HTML and CSS Sujana Jyothi Department of Computer Science"— Presentation transcript:

1 End User Computing More on HTML and CSS Sujana Jyothi Department of Computer Science sujana@cs.nuim.ie

2 Recap Monday 1 st February 2010: Introduction to HTML Wednesday 3 rd February 2010: Introduction to simple styling using CSS Today: Positioning objects in a webpage and how to divide a page into sections. End User Computing

3 Positioning in CSS If you want a picture or a section to be on the left or right hand side of a page, you set it to “float” right (or left). To further control positioning you can use “margins”. Let’s try an example End User Computing

4 Float Example Task: Move an image to the left of the page and have some text displayed alongside it. img { float:left; } End User Computing

5 Float Example End User Computing img { float:right; margin: 20px 15px 15px 15px; } Margin: T-R-B-L (trouble)‏ Move an image to the right hand side of the page and have text displayed alongside: it. Simple_html

6 Float Example Let us begin to build our page: Put a background colour Some more text A list Start_example.html Example.css

7 Menu Example End User Computing A Menu is generally just a list of links li { margin: 0px 0px -5px -40px; padding: 4px 3px 4px 12px; width: 180px; color: #4169E1; list-style-type: none; } Margin: T-R-B-L (trouble)‏

8 Menu Example End User Computing li { display: block; margin: 0px 0px -5px -40px; padding: 4px 3px 4px 12px; width: 180px; color: #4169E1; border-bottom: 1px solid #efefef; list-style-type: none; }

9 Dividing a page into sections End User Computing There are HTML tags called div's which are used to divide a page into different sections: Example text This makes development go much faster and allows you to create a template of each webpage very easily. These div's can then be styled in CSS to be positioned in a certain area of the page or to have a certain width or height and so on.

10

11 Dividing a page into sections End User Computing Header Footer Content Left Menu

12 In HTML End User Computing..... Hi I'm..... Home.... Holography.... Home...

13 The “id” End User Computing Sections of your webpage can be styled in CSS, this is done using id's. Each section can reference an id which is styled in CSS but each id must be UNIQUE in the CSS. So for example you can style links in a menu with blue text, and links in the main content page with orange text. Or you can have a paragraph with normal sized text and a paragraph with large text.

14 id Example End User Computing This is a normal paragraph with normal text This is a paragraph where the font size has been changed to a larger text. p { font-size: 12px; } p#LargeIntro { font-size: 24px; }

15 Develop a page from scratch: Part 1 End User Computing So now I'm going to show you how to develop a simple page from scratch using CSS and HTML. If at any stage you don't understand what I've done or want a more thorough explanation just stop me and ask.

16 Dividing the site End User Computing Final_example.html example.css

17 Dividing the site End User Computing Inside the we will have the division: 1) main Inside main we will have the divisions: i) header ii) content iii) menu example.html example.css

18 Final result End User Computing

19 Recap End User Computing -- 7 th February 2008 Ok, so we've covered today some of the ways you can position things with CSS (using floats/margins/padding). We've seen how a page can be broken down into sections using divisions This was a lot to cover in one lecture, on Monday we will be going through some more advanced CSS and using this we will finish off creating a homepage.


Download ppt "End User Computing More on HTML and CSS Sujana Jyothi Department of Computer Science"

Similar presentations


Ads by Google