Web Design (15) CSS Opacity, Link Colours & Background Images.

Slides:



Advertisements
Similar presentations
Cascading Style Sheets. CSS stands for Cascading Style Sheets and is a simple styling language which allows attaching style to HTML elements. CSS is a.
Advertisements

CSS Link Styling. The Anchor Element: Link text between the opening and closing can be styled using CSS. Some of the properties that can be set are: font-family,
กระบวนวิชา CSS. What is CSS? CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to.
Cascading Style Sheets Color and Background Controls Border and Margin Controls (Boxes)
Basics of Web Design Chapter 6 More CSS Basics Key Concepts.
CSE 154 LECTURE 3: MORE CSS. Cascading Style Sheets (CSS): HTML CSS describes the appearance and layout of information on a web page (as opposed.
TUTORIAL 4: CREATING PAGE LAYOUT WITH CSS Session 4.3.
Chapter 9. Links  When styling a link, you must tell CSS both what you want to style, and when you want the style to happen  Web browsers keep track.
Design, Formatting, CSS, & Colors 27 February, 2011.
Style sheets can also affect the BODY. style4.css BODY {BACKGROUND-COLOR : white} H1 {COLOR : red; FONT-SIZE : 50; FONT-FAMILY : arial} H2 {COLOR : green}
Style sheets can also affect the body. style4.css body {background-color : white} h1 {color : red; font-size : 50; font-family : arial} h2 {color : green}
CSSMR.Mostafa badr1. Lesson 3 Creating an Style Sheet Lesson 2 Structure of the Style Lesson 1: What Cascading Style Sheets are?
3.1 Cascading Style Sheets. Motto Fashions fade, style is eternal. —Yves Saint Laurent.
Cascading Style Sheets 1 Color and Backgrounds. Cascading Style Sheets 2 Color and Backgrounds Computer color basics Expression of color values using.
Cascading Style Sheets Example
CSS Dvijesh Bhatt.
HTML - Quiz #2 Attendance CODE:
HTML/CSS Hyper Text Markup Language. CSS Cascading Style Sheets.
Cascading Style Sheet (CSS)
1Computer Sciences Department. And use
WRT235: Writing in Electronic Environments CSS Backgrounds, colors, fonts.
CSS in XHTML continued Please use speaker notes for additional information!
 HTML stands for Hyper Text Mark-up Language. The coding language used to create documents for the World Wide Web  HTML is composed of tags. HTML tags.
Doman’s Sections Information in this presentation includes text and images from
(CSS) More Details Instructor: Mr. Ahmed Al Astal ITGD4104 Department Requirement for senior student University of Palestine Faculty of IT.
ITCS373: Internet Technology Week 3: Introduction to CSS Dr. Faisal Al-Qaed.
Just A Few More Fun Objectives 1 Having Some Fun With Java Script 2 Using Style Sheets.
11/6/13 MORE CSS!. TODAY’S AGENDA Review: float for positioning objects Review: CSS and color Introductions to: o CSS and images o CSS backgrounds o CSS.
Adding Graphics to Web Pages. CSS does not have any properties specifically aimed at formatting images Use properties you have already learned, i.e.,
Cascading Style Sheets in.NET Lilian Kiilu, Client/Server & Web Applications, Coms 463/563, Section 1pm, Fall 2005, November 16 th 2005.
CHAPTER 3 CSS & CSS3 อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1.
MySQL and PHP Review CSS. Cascading Style Sheet (CSS) Style sheets are files or forms that describe the layout and appearance of a document. Cascading.
HTML - Quiz #2 Attendance CODE:
Lesson 03 // Cascading Style Sheets. CSS Stands for Cascading Style Sheets. We’ll be using a combination of Html and CSS to create websites. CSS is a.
More CSS.
Web Design and Development for Business Lecture 4 Cascading Style Sheet (CSS)
CSS Tutorial 1 Introduction Syntax How to use style specifications. Styles.
Chcslonline.org Text –wrapping around Images. chcslonline.org To wrap text around an image, lets set up a style in our style sheet. open a new notepad.
>> The “Box” Model. Pre-requisite Create a new project in Netbeans called Week5 Create a new html file and name it box.html Create a new css file and.
CSS Class 2 -Add margins to elements on a page. -Set width and height of elements. - CSS shorthand properties for box model. -Style links. -Style tables.
CSS The Definitive Guide Chapter 9.  As has been stressed in CIS 131 or your initial learning of HTML5 “Planning” is important!  It is even more true.
Colors and backgrounds The following CSS properties will be explained: 1.color 2.background-color 3.background-image 4.background-repeat 5.background-attachment.
So far, we have looked at CSS selectors that correlate with HTML tags Now, we’ll see how you can define your own selectors using class and ID selectors.
Cascading Style Sheets (CSS). A style sheet is a document which describes the presentation semantics of a document written in a mark-up language such.
Cascading Style Sheets Eugenia Fernandez IUPUI. CSS Purpose CSS allow you to specify the style in which your XML elements are displayed. CSS were originally.
CSU - DCE Introduction to CSS CSS Colors - Fort Collins, CO Copyright © XTR Systems, LLC Cascading Style Sheets - Specifying Color Instructor: Joseph.
Adding a background image with CSS- The absolute basics CIT WINTER SEMESTER 2014 PRESENTED BY COLBY GRIFFITHS.
Colors and backgrounds The following CSS properties will be explained: 1.color 2.background-color 3.background-image 4.background-repeat 5.background-position.
Dawn Pedersen Art Institute. What Are CSS Sprites? Back in the day, sprites were the images in games that swapped one little image for another in a specific.
3.2 Cascading Style Sheets. 2 Positioning Elements Normally, elements are laid out on the page in the order that they are defined in the XHTML document.
Lecture 2: Cascading Style Sheets (CSS) Instructor: Dr. M. Anwar Hossain.
CSS Hadas Kahsay. Overview  What is CSS  Basic syntax of CSS Rules  How to link CSS style to html documents  Browsers and CSS  Advantages of CSS.
Web Technologies Beginning Cascading Style Sheets (CSS) 1Copyright © Texas Education Agency, All rights reserved.
Developing Web Applications with HTML and CSS “Selectors and Properties”
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
IS1825 Multimedia Development for Internet Applications Lecture 12: IDs, Classes and Internal CSS Rob Gleasure
NASRULLAHIBA.  It is time to take your web designing skills to the next level with Cascading Style Sheets (CSS). They are a way to control the look and.
Company LOGO In the Name of Allah,The Most Gracious, The Most Merciful King Khalid University College of Computer and Information System Web pages Development.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
1 CS428 Web Engineering Lecture 07 Font, Text & Background (CSS - II)
HTML & CSS Contents: the different ways we can use to apply CSS to The HTML documents CSS Colors and Background CSS Fonts CSS Text CSS box model: padding,
Links All CSS properties can be applied on links (i.e. change colors, fonts, underline, etc). The new thing is that CSS allows you to define these properties.
1 Cascading Style Sheets
WebD Introduction to CSS By Manik Rastogi.
More CSS.
Cascading Style Sheets
IS333: MULTI-TIER APPLICATION DEVELOPMENT
More CSS.
HTML LINKS
Presentation transcript:

Web Design (15) CSS Opacity, Link Colours & Background Images

Opacity (1) Making an element slightly see-through. The value for opacity is a number between: 0 (completely transparent) and 1 (completely opaque). So a value of 0.5 gives the element an opacity of 50%

Opacity (2) An Exercise Experiment with different levels of opacity, using these examples: h1 {color: green; background: white; opacity: 0.25;} h1 {color: green; background: white; opacity: 0.5;} h1 {color: green; background: white; opacity: 1;} Notice that the opacity affects both the foreground and the background colors.

Link colors (1) Have you noticed that a link is one color when you first visit it and then another color when you go back to that page? By default, browsers display linked text as blue and links that have been visited as purple. You can change these colors with a few style rules

Link colors (2) Try this out: a:link {color: maroon;} a:visited {color: gray;} Here the unvisited link will be maroon in color; becoming gray once visited.

Link colors (3) a:hover a:hover causes the link color to change as the mouse pointer hovers over it. Try these 2 examples out with the previous exercise: a:hover {color: red;} a:hover {color: maroon; background-color: #ffd9d9;} (In the 2 nd example the background changes)

Link colors (4) If you wish to turn off the underlines that appear with your links, use the following: a {text-decoration: none} Try this out!

Link colors (5) Lastly, note that for these link color selectors to work, they must appear in the following order (or they may override other states) So: a {text-decoration: none} /*turns underlines off for all links*/ a:link {color: maroon;} a:visited {color: gray;} a:hover {color: maroon; background-color: #ffd9d9;}

Background Images (1) Background images can be given to the body as a whole or to a division within the body. Method: Place a simple image (e.g. a star) in the images folder. Then in the css file: body {background-image: url(images/star.png);} The image will be automatically repeated in the space available

Background Images (2) You can also restrict the image to tiling only horizontally: body {background-image: url(images/star.png); background-repeat: repeat-x;} only veritcally: body {background-image: url(images/star.png); background-repeat: repeat-y;} or only appearing once: body {background-image: url(images/star.png); background-repeat: no repeat;}

Background Images (3) And the position of the original (first) image can be set as follows: background-position: left-bottom; background-position: right centre; background-position: 200px 50px; background-position: 15% 100%; (both measured from top left, horizontal and then vertical)

Background Images (4) Some useful coding shorthand. Instead of: body {background-color: white; background-image: url(images/star.png); background-repeat: no- repeat; background position: right-top:} this shorter version: body { background: white url(images/star.png) no-repeat right top; }

Background Images (5) Multiple backgrounds are now also possible! So, the shorthand coding: body { background: url(image1.png) left top no-repeat, url(image2.png) center center no-repeat, url(image1.png) right bottom no-repeat; } would produce 3 images diagonally across your page!

Background Images (6) What about a rainbow effect?! Try these: body {background-image: linear-gradient (to bottom, yellow, green); } body {background-image: linear-gradient (90deg, yellow, orange 25%, blue); } body {background-image: radial-gradient (center contain yellow green); }