方框的CSS樣式.

Slides:



Advertisements
Similar presentations
Cascading Style Sheets Color and Background Controls Border and Margin Controls (Boxes)
Advertisements

9-May-15 More CSS. 2 A different emphasis CSS is the same for XML as it is for HTML and XHTML, but-- XML contains no display information If you want your.
Today’s objectives Site performance Padding, Margins, Borders
Week 9 Using the Box Properties. 9-2 The CSS Visual Formatting Model Describes how the element content boxes should be displayed by the browser –Based.
Tutorial 4: Creating page layout with css
CSS: Class 1 Background Images, Controlling Position of Background Images, Add Padding to Page Elements, Add Borders to Elements on a Page.
Working with Cascading Style Sheets
 2003 Prentice Hall, Inc. All rights reserved. Chapter 6 - Cascading Style Sheets™ (CSS) Outline 6.1 Introduction 6.2 Inline Styles 6.3 Embedded Style.
Slide 1 of 62 CSS Pseudo-classes The syntax of pseudo- classes: selector:pseudo-class { property:value; } A pseudo-class is used to define a special state.
CSS Properties  Font  Color & Background  Text  List  Box Model  Visual Formatting Model (normal & float)  User Interface & Downloadable Font 
網頁設計 CSS Box Model 與定位方式 Foreground and Background Colors, Textures and Images.
1 Lesson Style Sheets Box Model Content (text,image,table) Margin Padding Border Box.
Basics of Web Design Chapter 6 More CSS Basics Key Concepts 1.
Text Properties, Line Box, CSS. Text Properties Properties related to the display of text. Text-align : left, right, center I like FSU!
Cascading Style Sheets Part 3 Fall, 2007 Modified by Linda Kenney Nov. 12, 2007.
Tutorial 3 Working with Cascading Style Sheets. XP Objectives Review the history and concepts of CSS Explore inline styles, embedded styles, and external.
Streamlining Website Development in Dreamweaver Roger L. Runquist Western Illinois University Roger L. Runquist Western Illinois University.
CSS Box Model margin border padding content 23. Box Model Properties PropertyValid valuesExample border-widththin, medium, thick, numberborder-width:
Introduction to Web Site Development Steven Emory Department of Computer Science California State University, Los Angeles Lecture 6: Cascading Style Sheets.
Intro to Cascading Style Sheets IS 373—Web Standards Todd Will.
14-Jul-15 CSS Applications to XML. 2 A different emphasis CSS is the same for XML as it is for HTML, but-- HTML already does a pretty good job of layout.
Lecture CSS: Cascading Style Sheets. What are Styles? Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation semantics.
Selectors thru Borders. CSS – Cascading Style Sheets – is a way to style HTML HTML is the content base of a web page CSS provides the presentation qualities.
Cascading Style Sheets CS3505. What are CSS? Method for adding style attributes consistently to HML tags Cascading because styles are applied in order.
Cascading Style Sheets Billy Toy Cascading Style Sheets Syntax review How to Implement style sheets Background properties Text properties.
Dreamweaver -- CSS. Dreamweaver -- MX New icons are added in MX Most of the features commonly used in web design, and are same as FrontPage. New feature.
XHTML and CSS Links, Images, Tables and Forms Bharti Patel 1 phones off (please)
1.NET Web Forms CSS: Style Sheets © 2002 by Jerry Post.
For the World Wide Web.  A style sheet is a set of code that describes the layout and appearance of a web page.  HTML specifies the content and structure.
Cascading Style Sheets, pt 2 ECA 225 Applied Online Programming.
Cascading Style Sheets CSS. CSS - Structure Declaration block Property: identifies what to change Value: how to change it Selector – example h1{ font-size:
Tutorial 3 Working with Cascading Style Sheets (CSS)
Advanced CSS & HTML 5 Introduction to Web Design and Development.
Unit 5 – HTML Tables Instructor: Brent Presley.
CIS 1315 – Web Development for Educators CIS 1315 HTML Tutorials 3 & 4: Working With CSS.
CSS Border.
Today’s objectives  Assignment 1  Padding, Margins, Borders  Fluid Layout page  Building accessible Table  Element size with padding and border 
FTS: The Perils and Promise of Computing Cascading Style Sheets (CSS) Gustavus Adolphus College Fall 2012.
Lecture # 33 Cascade Style Sheets (CSS). Cascade Style Sheets (CSS): Preserving a consistent “look and feel” of a website across multiple pages.
INTRODUCTION TO WEB DEVELOPMENT AND HTML Lecture 10: A Deeper Look at CCS- Spring 2011.
CHAPTER 3 CSS & CSS3 อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา 1.
COMP213 – Web Interface Design
LITTLE BOXES Controlling size of boxes Box model for borders, margin and padding Displaying and hiding boxes.
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.
Part 4 Introduction to CSS. CSS Table Table Borders table, td, th { border:1px solid black; } Firstname Lastname Bader Ali Paul Manuel The example below.
Creating Your Own Webpage COSC Cascading Stylesheets Think of: HTML: content of your webpage HTML has tags CSS: presentation and appearance of your.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 6 Key Concepts 1 Copyright © Terry Felke-Morris.
Cascading Style Sheets Chapters 5-6 Color and Background Controls Border and Margin Controls.
Cascading Style Sheets Part 3 Spring, 2008 Modified by Linda Kenney April 21, 2008.
Web Foundations THURSDAY, OCTOBER 3, 2013 LECTURE 6: CSS CONTINUED.
>> 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.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 6 - Cascading Style Sheets™ (CSS) Outline 6.1 Introduction 6.2 Inline Styles 6.3 Embedded Style.
1 CS428 Web Engineering Lecture 08 Border, Margin, Padding … (CSS - III)
Copyright © 2006, Jumail, FSKSM, UTM Slide 1 Cascading Style Sheets (CSS)
CSS Layout Cascading Style Sheets. Lesson Overview  In this lesson, you will learn:  CSS Box Model  CSS properties for border  CSS properties for.
©SoftMoore ConsultingSlide 1 Introduction to HTML: Cascading Style Sheets.
CSS – Cascading Style Sheets
Extra-simplified.  Only truly happen when the CSS and HTML are defined as separate files (external style sheet) Introduction The main idea of CSS is.
CSE 154 LECTURE 4: PAGE SECTIONS AND THE CSS BOX MODEL.
JavaScript and CSS
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring 2016 CSS Positioning 1.
Doncho Minkov Telerik School Academy schoolacademy.telerik.com Technical Trainer
HTML and Dreamweaver November 11th. Agenda Box Model Displaying and positioning elements – Padding – Margin – Float – Display – Position HTML Demo.
CSS Box Model. What is the Box Model? Each XHTML element appearing on our page takes up a "box" or "container" of space. Each box size is affected not.
End User Computing Applied CSS: Building our course homepage Sujana Jyothi Department of Computer Science
ECA 228 Internet/Intranet Design I Cascading Style Sheets.
Tutorial #5 Working with the Box Model. Tutorial #4 Review - CSS Create a homework page Final Project Discussion Exam on Blackboard Styling Lists (List-style-type,
CS 120: Introduction to Web Programming Lecture 10: Extra Features and Website Design Part 1 Tarik Booker CS 120 California State University, Los Angeles.
Unit 3 - Review. Topics 1. Tag, Attribute, Value 2. CSS Rule Syntax + link 3. Categories of Selectors 4. Inline vs Block Tags 5. CSS Layout 6. CSS Box.
Presentation transcript:

方框的CSS樣式

div { margin: 40px; border: 20px groove #630; padding: 60px; background-color: white; float:left; } ... <div><img src="..." alt="" width="" /></div>

Box Model http://msdn.microsoft.com/en-us/library/bb250395.aspx

Box相關屬性 height, width (內容高度與寬度) margin (元素間距) border (邊框) padding (內距) max-height, max-width min-height, min-width margin (元素間距) margin-top, margin-right, margin-bottom, margin-left border (邊框) border-width border-top-width, border-right-width, border-bottom-width, border-left-width border-style border-top-style, border-right-style, border-bottom-style, border-left-style border-color border-top-color, border-right-color, border-bottom-color, border-left-color border border-top, border-right, border-bottom, border-left padding (內距) padding-top, padding-right, padding-bottom, padding-left

height, width (內容高度與寬度) 內容之高度與寬度 height, width max-height, max-width min-height, min-width dd {min-height: 4pc;} http://www.im.ncnu.edu.tw/~ycchen/www2009/lab/

margin (元素間距) margin: 20px;  上右下左各20px margin: 30px 2em;  上下各30px, 右左各2em margin: 0.5in 15px 1in;  上0.5in, 右左各15px, 下30px margin: 40px 25% 1em 30px;  上40px, 右25%, 下1em, 左30px margin-top: 15px; margin-right: -30px; margin-bottom: 20px; margin-left: 10%;

元素置中顯示 h1 { margin-left: auto; margin-right: auto; width:140px; border: 1px solid blue; } <h1>CSS方框</h1>

垂直間距之塌陷 marginc.html h1 { font-size:18pt; margin:40px 10px; border:5px double #630; padding:3px; background-color: #cfc; } h2 { font-size:14pt; margin:15px 10px; padding:3px 5px; background-color: black; color: white; <h1>景點簡介</h1> <h2>中路坑溼地</h2>

border (邊框) border-width (邊框厚度) border-color (邊框顏色) border-top-width, border-right-width, border-bottom-width, border-left-width border-color (邊框顏色) border-top-color, border-right-color, border-bottom-color, border-left-color border-style (邊框樣式) border-top-style, border-right-style, border-bottom-style, border-left-style border (厚度 樣式 顏色 同時設定) border-top, border-right, border-bottom, border-left

border-width (邊框厚度) border-width border-top-width, border-right-width, border-bottom-width, border-left-width border-width: 1px; border-left-width: 10px; border-color: orange; border-style: solid; thin | medium | thick | <length>

border-color (邊框顏色) border-color border-top-color, border-right-color, border-bottom-color, border-left-color border-color: red #00FF00 #00F rgb(128,0,128);

border-style (邊框樣式) border-style: solid; solid | double | dashed | dotted | groove | ridge | inset | outset | none | hidden

example border-style: solid none none solid; border-style: outset none; border-left-style: double; border-style: none ridge none;

border厚度 樣式 顏色 同時設定 border: width style color border-left: width style color border: 1px solid orange; border-left: 10px solid orange;

padding (內距) padding padding: 20px; padding: 20px 25% 1em 20px; padding-top, padding-right, padding-bottom, padding-left padding-left: 1.5em; padding-top: 1pc;