[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-693040-105":3,"detail-sidebar-cat-0-en-105":80,"doc-detail-693040-en":130,"doc-similar-693040":154},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":73,"head_meta":75,"extra_data":77,"updated_unix":79},105,"en","css-tutorial-part-1-introduction-adding-style-to-a-web-page","CSS Tutorial Part 1 - Introduction - Adding Style to a Web Page","","CSS Tutorial Part 1 introduces how CSS controls the appearance of HTML elements and explains three ways to apply styles: inline styles, styles embedded in the head section, and external stylesheets linked from the head. It provides an example paragraph style using properties like background-color, color, and line-height. The tutorial then guides users through creating a separate CSS file, attaching it to an HTML page, and defining tag-based styles for elements such as paragraphs and fonts, including basic color options and changing text color.",{"@graph":14,"@context":72},[15,34,55],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/document/","Document",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/document/technology/","Technology",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/css-tutorial-part-1-introduction-adding-style-to-a-web-page/693040/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/css-tutorial-part-1-introduction-adding-style-to-a-web-page/693040.png","ImageObject",300,407,{"name":42,"@type":43},"Liam","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-11-19","2026-11-09",true,{"@type":52,"interactionType":53,"userInteractionCount":33},"InteractionCounter",{"@type":54},"ViewAction",{"@type":56,"mainEntity":57},"FAQPage",[58,64,68],{"name":59,"@type":60,"acceptedAnswer":61},"What is CSS used for in an HTML page?","Question",{"text":62,"@type":63},"CSS adds style to HTML tags. It controls how elements look, such as text color, background color, and spacing.","Answer",{"name":65,"@type":60,"acceptedAnswer":66},"What are the three methods to add CSS to a web page?",{"text":67,"@type":63},"The tutorial lists: Method 1 uses inline style in the tag, Method 2 places CSS in the head with a style block, and Method 3 links an external .css stylesheet file.",{"name":69,"@type":60,"acceptedAnswer":70},"How do you create and attach a separate CSS file for Method 3?",{"text":71,"@type":63},"Create a blank .css file, write the styles into it, save it (e.g., tutorial.css), then attach it in the HTML head using a link tag to the stylesheet file.","https://schema.org",{"og:url":32,"og:type":74,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":76,"canonical":32},"index,follow",{"doc_id":78,"site_id":7},693040,1794246453,{"code":4,"msg":81,"data":82},"success",[83,87,91,95,100,104,109,114,119,122,126],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":84,"show_sort_weight":85,"slug":86},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":88,"show_sort_weight":89,"slug":90},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":92,"show_sort_weight":93,"slug":94},"Exam",70,"exam",{"id":96,"doc_module":4,"doc_module_name":25,"category_name":97,"show_sort_weight":98,"slug":99},5,"Comic",60,"comic",{"id":101,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":102,"slug":103},6,50,"technology",{"id":105,"doc_module":4,"doc_module_name":25,"category_name":106,"show_sort_weight":107,"slug":108},7,"Healthcare",40,"healthcare",{"id":110,"doc_module":4,"doc_module_name":25,"category_name":111,"show_sort_weight":112,"slug":113},8,"Research & Report",30,"research-report",{"id":115,"doc_module":4,"doc_module_name":25,"category_name":116,"show_sort_weight":117,"slug":118},9,"Religion & Spirituality",20,"religion-spirituality",{"id":117,"doc_module":4,"doc_module_name":25,"category_name":120,"show_sort_weight":117,"slug":121},"World Cup","world-cup",{"id":123,"doc_module":4,"doc_module_name":25,"category_name":124,"show_sort_weight":123,"slug":125},10,"Lifestyle","lifestyle",{"id":127,"doc_module":4,"doc_module_name":25,"category_name":128,"show_sort_weight":96,"slug":129},19,"General","general",{"code":4,"msg":81,"data":131},{"doc_id":78,"user_id":132,"nickname":42,"user_avatar":133,"doc_module":4,"category_id":101,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":33,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":139,"language":140,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":12,"update_tm":79,"read_time":144,"preview_page_count":26,"preview_urls":145},8796095461564,"https://ap-avatar.wpscdn.com/davatar_155a257f0dc6eb9ab79c44ca47cae57d","CSS Tutorial Part 1 :  \nIntroduction:  \nCSS adds style to tags in your html page. With HTML you told the browser what things were (e.g., this is a paragraph) . Now you are telling the browser how things look (e.g., I want my paragraphs to have blue text with double-spacing anda purple background) . To make all paragraphs have the style just mentioned, you’d add the following CSS code (I’ll explain what each line means in detail later):  \np { background-color: purple;  \ncolor: blue;  \nline-height: 200%;  \n}  \nA. Adding Style to a Web Page (3 options):  \nYou can add a style to your web page in 3 different ways:  \nMethod 1. By including the style inline (e.g., in the tag itself in your html document), e.g.,:  \n\u003Cbody>  \n\u003Cp style = “background-color: purple; color: blue; line-height: %200;” > This is a blue paragraph with a purple background color \u003C/p>  \n…  \nMethod 2. By including the style in the head section of the web page, e.g.,:  \n\u003Chead>  \n\u003Cmeta charset=”utf-8\" />  \n\u003Ctitle> The web page \u003C/title>  \n\u003Cstyle >  \np { background-color: purple;  \ncolor: blue;  \nline-height: 200%;  \n}  \n\u003C/style>  \n\u003C/head>  \n**Method 3 ** By attaching a “style sheet” to your web page, and then placing all your styles in that new style sheet.  \nTo do this, you first create a brand new file (not a web page, a brand new completely blank file) . You put in this brand new completely blank file they style(s) you want (e.g.,:  \np { background-color: purple;  \ncolor: blue;  \nline-height: 200%;  \n}  \nOnce the file contains a style, save it as blablabla.css. The blablabla part can be some other name, if you prefer, but the.css must be just that.  \nNow you’ve got to attach the style file to your html file. If you skip this step, the styles you’ve created in the css file won’t be applied to the web page you’ve created. To attach the css stylesheet to the web page, in the head section, add a link to the style as such:  \n\u003Chead>  \n\u003Cmeta charset=”utf-8\" />  \n\u003Ctitle>The web page \u003C/title>  \n\u003Clink rel=\"stylesheet\" href=\"blablabla.css\">  \n\u003C/head>  \nAll 3 methods will work. Method 1 allows for quick and easy changes to style, and method 2 has the advantage of keeping your styles within the same file as your html code, but can lead to very big html files, and but can get hard to keep track of when making changes.  \nMethod 3, however, is my preferred method. Method 3 allows you to create a style sheet separate from your webpage(s) . Once the style sheet is created, you can include it in as many web pages as you wish. Thus, if you have a website with a large number of web pages, and you want to change the look of the entire web site, you just need to change one style sheet. In addition, you can create a number of different style sheets with very different styles. Then you can completely change the look of your web page simply by changing which style sheet you link to it. For an example of how completely you can change the look of a web page simply by changing its style sheet, visit:  \n[http://www.csszengarden.com/](http://www.csszengarden.com/)  \nThus, for our tutorials and class project, I will insist you use a separate style sheet as specified using Method 3 and place most of your styles in the stylesheet.  \nB. Creating Styles:  \nNow you know how to include a style. But you don’t know how to create a style. So we’d better learn that. You must apply a style to html tags, so first create or download an html page:  \nStep 1 (for method 3):  \nCreate a separate CSS file.  \n􀁸 Open a new file in notepad++/wrangler  \n􀁸 Save it with a .css extension (I will call mine tutorial.css, but you can call it whatever you like)  \nStep 2:  \n(Note that this is still for method 3 to attach our style to the html page)  \nAttach the CSS file to your html file. You must attach the css file to the html file or the styles won’t show up.  \n1. Open the HTML file in notepad++/wrangler  \n2. In between the \u003Chead> and the \u003C/head> tag, add the following line (with your file name):  \n\u003C!DOCTYPE html>  \n\u003Chtml> ","cbCaiaidgJH71P5a","https://ap.wps.com/l/cbCaiaidgJH71P5a","pdf",1031624,11,"English","# Introduction\n## Adding Style to a Web Page (3 options)\n### Method 1: Inline Style\n### Method 2: Style in Head\n### Method 3: External Style Sheet\n## Creating Styles: Applying Styles to Tags\n## Styling with Color and Changing Text Properties","[{\"question\":\"What is CSS used for in an HTML page?\",\"answer\":\"CSS adds style to HTML tags. It controls how elements look, such as text color, background color, and spacing.\"},{\"question\":\"What are the three methods to add CSS to a web page?\",\"answer\":\"The tutorial lists: Method 1 uses inline style in the tag, Method 2 places CSS in the head with a style block, and Method 3 links an external .css stylesheet file.\"},{\"question\":\"How do you create and attach a separate CSS file for Method 3?\",\"answer\":\"Create a blank .css file, write the styles into it, save it (e.g., tutorial.css), then attach it in the HTML head using a link tag to the stylesheet file.\"}]","CSS Tutorial Part 1 - Introduction - Adding Style to a Web Page | PDF",28,[146,150],{"page_no":22,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/8602a80e2ebbf07dc63ab2eccbb5d7de.webp",983,1272,{"page_no":26,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/51ec1a97b43aa9778e67cf421527373a.webp",982,1270,{"list":155,"token":11},[156,162,168,174,180,186,192,198,203,209],{"doc_id":157,"doc_title":158,"file_type":137,"home_preview_img_url":159,"slug":160,"view_count":101,"category_name":29,"create_tm":161},699464,"Basic CSS - Lecture 4 - CSS Styling Fundamentals","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230010042266/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=1O%2BA8CuXm3mSit2dPiwSUPDGu1s%3D","basic-css-lecture-4-css-styling-fundamentals",1794468368,{"doc_id":163,"doc_title":164,"file_type":137,"home_preview_img_url":165,"slug":166,"view_count":33,"category_name":29,"create_tm":167},693038,"HTML Styles-CSS - learn cascading style sheets","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230005053917/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=Etyox21Wu84XRzdzKG0HJOEaXGs%3D","html-styles-css-learn-cascading-style-sheets",1794246445,{"doc_id":169,"doc_title":170,"file_type":137,"home_preview_img_url":171,"slug":172,"view_count":96,"category_name":29,"create_tm":173},685836,"Internet Fundamentals - Introduction to Web Technologies - Lecture 3 - Cascading Style Sheets","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999697016/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=RF%2FoH7UiVFTTJceENuJCAkfOdJE%3D","internet-fundamentals-introduction-to-web-technologies-lecture-3-cascading-style-sheets",1794019250,{"doc_id":175,"doc_title":176,"file_type":137,"home_preview_img_url":177,"slug":178,"view_count":101,"category_name":29,"create_tm":179},699461,"CSS Cascading Style Sheets - Basic CSS Properties Syntax and Usage","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230011003513/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=R2KL5Pq6FKuIkVscj7oVwUeXGhg%3D","css-cascading-style-sheets-basic-css-properties-syntax-and-usage",1794468363,{"doc_id":181,"doc_title":182,"file_type":137,"home_preview_img_url":183,"slug":184,"view_count":33,"category_name":29,"create_tm":185},697983,"Complete HTML Tags list with examples","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230010150461/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=AsXMV8nKeKDtcICyLcO6dpis1%2BE%3D","complete-html-tags-list-with-examples",1794446726,{"doc_id":187,"doc_title":188,"file_type":137,"home_preview_img_url":189,"slug":190,"view_count":33,"category_name":29,"create_tm":191},686715,"HTML and CSS Basics - III - CSS review, backgrounds, fonts, and the box model","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230001090598/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=if5nqI7W1nZ%2BB5oT9opbObZKhd0%3D","html-and-css-basics-iii-css-review-backgrounds-fonts-and-the-box-model",1794061491,{"doc_id":193,"doc_title":194,"file_type":137,"home_preview_img_url":195,"slug":196,"view_count":96,"category_name":29,"create_tm":197},681943,"How To Build a Website with HTML - Part 1 - Introduction","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229999293528/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=afqxJkOKseM%2FaA%2BcWP3E5JVGElI%3D","how-to-build-a-website-with-html-part-1-introduction",1793957208,{"doc_id":199,"doc_title":200,"file_type":137,"home_preview_img_url":201,"slug":200,"view_count":30,"category_name":29,"create_tm":202},732844,"complete-html-tags-list-with-examples-free-pdf1","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230031779762/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=6SK3RlKiEgF1fmOByt3hUvIMydo%3D",1795382433,{"doc_id":204,"doc_title":205,"file_type":137,"home_preview_img_url":206,"slug":207,"view_count":96,"category_name":29,"create_tm":208},699465,"HTML and CSS - CSE316 Fundamentals of Software Development","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230010042286/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=GK3Vsj8O4UU0XMrREVZxJn2LSYU%3D","html-and-css-cse316-fundamentals-of-software-development",1794468371,{"doc_id":210,"doc_title":211,"file_type":137,"home_preview_img_url":212,"slug":213,"view_count":214,"category_name":29,"create_tm":215},491464,"HTML Cheat Sheet - A quick guide to HTML, CSS, and JavaScript basics","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229928196033/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111279&Signature=l%2BG1PYTltBnz8gazNbLSZv58Khg%3D","html-cheat-sheet-a-quick-guide-to-html-css-and-javascript-basics",21,1790849720]