[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-693038-en":3,"doc-seo-693038-105":41,"detail-sidebar-cat-0-en-105":106,"doc-similar-693038":152},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":20,"is_deleted":4,"is_public":21,"is_downloadable":21,"audit_status":21,"page_count":22,"language":23,"language_code":24,"site_id":25,"html_lang":24,"table_of_contents":26,"faqs":27,"seo_title":28,"seo_description":14,"update_tm":29,"read_time":30,"preview_page_count":31,"preview_urls":32},693038,137441390410,"Hazel","https://ap-avatar.wpscdn.com/avatar/2000252f4ab5702993?_k=1776741390130283984",6,"Technology","HTML Styles-CSS - learn cascading style sheets","Learn the basics of Cascading Style Sheets (CSS) and how they format web pages. The material explains what CSS is, why it saves work, and how it controls layout across multiple pages. It demonstrates three ways to add CSS: inline styles, internal styles via the \u003Cstyle> element in \u003Chead>, and external styles using \u003Clink> to a .css file. It also covers common CSS properties such as color, font-family, font-size, border, padding, and margin, plus practical examples for linking external style sheets and using HTML style tags.","HTML Styles-CSS  \nCSS stands for Cascading Style Sheets.  \nCSS saves a lot of work. It can control the layout of multiple web pages all at once.  \nWhat is CSS?  \nCascading Style Sheets (CSS) is used to format the layout of a webpage.  \nWith CSS, you can control the color, font, the size of text, the spacing between elements, how elements are positioned and laid out, what background images or background colors are to be used, different displays for different devices and screen sizes, and much more!  \nTip: The word cascading means that a style applied to a parent element will also apply to all children elements within the parent. So, if you set the color of the body text to \"blue\", all headings, paragraphs, and other text elements within the body will also get the same color (unless you specify something else)!  \n Using CSS  \nCSS can be added to HTML documents in 3 ways:  \n•  Inline-by using the style attribute inside HTML elements  \n•  Internal-by using a \u003Cstyle> element in the \u003Chead> section  \n•  External-by using a \u003Clink> element to link to an external CSS file  \nThe most common way to add CSS, is to keep the styles in external CSS files. However, in this tutorial we will use inline and internal styles, because this is easier to demonstrate, and easier for you to try it yourself.  \nInline CSS  \nAn inline CSS is used to apply a unique style to a single HTML element.  \nAn inline CSS uses the style attribute of an HTML element.  \nThe following example sets the text color of the \u003Ch1> element to blue, and the text color of the \u003Cp> element to red:  \nExample  \n\u003Ch1 style=\"color:blue;\">A Blue Heading\u003C/h1>\u003Cp style=\"color:red;\">A red paragraph.\u003C/p>  \n Internal CSS  \nAn internal CSS is used to define a style for a single HTML page.  \nAn internal CSS is defined in the \u003Chead> section of an HTML page, within a \u003Cstyle> element.  \nThe following example sets the text color of ALL the \u003Ch1> elements (on that page) to blue, and the text color of ALL the \u003Cp> elements to red. In addition, the page will be displayed with a \"powderblue\" background color:  \nExample  \n\u003C !DOCTYPE html>\u003Chtml>  \n\u003Chead>\u003Cstyle>  \nbody {background-color: powderblue;} h1 {color: blue;}  \np {color: red;}  \n\u003C/style>  \n\u003C/head>\u003Cbody>  \n\u003Ch1>This is a heading \u003C/h1>\u003Cp>This is a paragraph.\u003C/p>  \n\u003C/body>  \n\u003C/html>  \n External CSS  \nAn external style sheet is used to define the style for many HTML pages.  \nTo use an external style sheet, add a link to it in the \u003Chead> section of each HTML page:  \nExample  \n\u003C !DOCTYPE html>\u003Chtml>  \n\u003Chead>  \n\u003Clink rel=\"stylesheet\" href=\"styles.css\">\u003C/head>  \n\u003Cbody>  \n\u003Ch1>This is a heading \u003C/h1>\u003Cp>This is a paragraph.\u003C/p>  \n\u003C/body>  \n\u003C/html>  \nThe external style sheet can be written in any text editor. The file must not contain any HTML code, and must be saved with a .css extension.  \nHere is what the \"styles.css\" file looks like:  \n\"styles.css\":  \nbody {  \nbackground-color: powderblue;}  \nh1 {  \ncolor: blue;}  \np {  \ncolor: red;}  \nTip: With an external style sheet, you can change the look of an entire web  \nsite, by changing one file!  \nHere, we will demonstrate some commonly used CSS properties. You will learn more about them later.  \nThe CSS color property defines the text color to be used.  \nThe CSS font-family property defines the font to be used.  \nThe CSS font-size property defines the text size to be used.  \nExample  \nUse of CSS color, font-family and font-size properties:  \n\u003C !DOCTYPE html>\u003Chtml>  \n\u003Chead>\u003Cstyle> h1 {  \ncolor: blue;  \nfont-family: verdana;  \nfont-size: 300%;}  \np {  \ncolor: red;  \nfont-family: courier;  \nfont-size: 160%;}  \n\u003C/style>  \n\u003C/head>\u003Cbody>  \n\u003Ch1>This is a heading \u003C/h1>\u003Cp>This is a paragraph.\u003C/p>  \n\u003C/body>  \n\u003C/html>  \nCSS Border  \nThe CSS border property defines a border around an HTML element. Tip: You can define a border for nearly all HTML elements.  \nExample  \nUse of CSS border property:  \np {  \nborder: 2px solid powderblue;}  \nCSS Padding  \nThe CSS padding property defines a padding (space) between the text and the b","cbCaiiPaVm8O8woV","https://ap.wps.com/l/cbCaiiPaVm8O8woV","pdf",224566,4,1,20,"English","en",105,"# What is CSS?\n# Using CSS\n## Inline CSS\n## Internal CSS\n## External CSS\n# Common CSS Properties\n## CSS color, font-family, font-size\n## CSS border, padding, margin\n# Link to External CSS\n# HTML Style Tags","[{\"question\":\"What does CSS stand for, and what is it used for?\",\"answer\":\"CSS stands for Cascading Style Sheets. It is used to format the layout of a webpage and control styling such as color, fonts, spacing, positioning, and backgrounds.\"},{\"question\":\"How can CSS be added to HTML documents?\",\"answer\":\"CSS can be added using inline styles (the style attribute), internal styles (a \\u003cstyle\\u003e element inside \\u003chead\\u003e), or external styles (a \\u003clink\\u003e element pointing to an external .css file).\"},{\"question\":\"What are some commonly used CSS properties covered in the tutorial?\",\"answer\":\"The tutorial demonstrates CSS properties including color, font-family, font-size, border, padding, and margin, along with examples of how they affect elements.\"}]","HTML Styles-CSS - learn cascading style sheets | PDF",1794246445,50,2,[33,37],{"page_no":21,"url":34,"width":35,"height":36},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/47f1aff67c39bef5f6aaec656ec9eb80.webp",983,1272,{"page_no":31,"url":38,"width":39,"height":40},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/55a416a5bd47cf95224cbd3d4a8b9b0a.webp",982,1270,{"code":4,"msg":42,"data":43},"ok",{"site_id":25,"language":24,"slug":44,"title":13,"keywords":45,"description":14,"schema_data":46,"social_meta":101,"head_meta":103,"extra_data":105,"updated_unix":29},"html-styles-css-learn-cascading-style-sheets","",{"@graph":47,"@context":100},[48,63,83],{"@type":49,"itemListElement":50},"BreadcrumbList",[51,55,58,61],{"item":52,"name":53,"@type":54,"position":21},"https://docshare.wps.com","Home","ListItem",{"item":56,"name":57,"@type":54,"position":31},"https://docshare.wps.com/document/","Document",{"item":59,"name":12,"@type":54,"position":60},"https://docshare.wps.com/document/technology/",3,{"item":62,"name":13,"@type":54,"position":20},"https://docshare.wps.com/document/html-styles-css-learn-cascading-style-sheets/693038/",{"url":62,"name":13,"@type":64,"image":65,"author":70,"headline":13,"publisher":72,"fileFormat":75,"inLanguage":24,"description":14,"dateModified":76,"datePublished":77,"encodingFormat":75,"isAccessibleForFree":78,"interactionStatistic":79},"DigitalDocument",{"url":66,"@type":67,"width":68,"height":69},"https://docshare.wps.com/thumbnails/html-styles-css-learn-cascading-style-sheets/693038.png","ImageObject",300,407,{"name":9,"@type":71},"Person",{"url":52,"name":73,"@type":74},"DocShare","Organization","application/pdf","2026-11-14","2026-11-09",true,{"@type":80,"interactionType":81,"userInteractionCount":20},"InteractionCounter",{"@type":82},"ViewAction",{"@type":84,"mainEntity":85},"FAQPage",[86,92,96],{"name":87,"@type":88,"acceptedAnswer":89},"What does CSS stand for, and what is it used for?","Question",{"text":90,"@type":91},"CSS stands for Cascading Style Sheets. It is used to format the layout of a webpage and control styling such as color, fonts, spacing, positioning, and backgrounds.","Answer",{"name":93,"@type":88,"acceptedAnswer":94},"How can CSS be added to HTML documents?",{"text":95,"@type":91},"CSS can be added using inline styles (the style attribute), internal styles (a \u003Cstyle> element inside \u003Chead>), or external styles (a \u003Clink> element pointing to an external .css file).",{"name":97,"@type":88,"acceptedAnswer":98},"What are some commonly used CSS properties covered in the tutorial?",{"text":99,"@type":91},"The tutorial demonstrates CSS properties including color, font-family, font-size, border, padding, and margin, along with examples of how they affect elements.","https://schema.org",{"og:url":62,"og:type":102,"og:title":13,"og:site_name":73,"og:description":14},"article",{"robots":104,"canonical":62},"index,follow",{"doc_id":7,"site_id":25},{"code":4,"msg":5,"data":107},[108,112,116,120,125,127,132,137,141,144,148],{"id":21,"doc_module":4,"doc_module_name":57,"category_name":109,"show_sort_weight":110,"slug":111},"Story & Novel",90,"story-novel",{"id":31,"doc_module":4,"doc_module_name":57,"category_name":113,"show_sort_weight":114,"slug":115},"Literature",80,"literature",{"id":20,"doc_module":4,"doc_module_name":57,"category_name":117,"show_sort_weight":118,"slug":119},"Exam",70,"exam",{"id":121,"doc_module":4,"doc_module_name":57,"category_name":122,"show_sort_weight":123,"slug":124},5,"Comic",60,"comic",{"id":11,"doc_module":4,"doc_module_name":57,"category_name":12,"show_sort_weight":30,"slug":126},"technology",{"id":128,"doc_module":4,"doc_module_name":57,"category_name":129,"show_sort_weight":130,"slug":131},7,"Healthcare",40,"healthcare",{"id":133,"doc_module":4,"doc_module_name":57,"category_name":134,"show_sort_weight":135,"slug":136},8,"Research & Report",30,"research-report",{"id":138,"doc_module":4,"doc_module_name":57,"category_name":139,"show_sort_weight":22,"slug":140},9,"Religion & Spirituality","religion-spirituality",{"id":22,"doc_module":4,"doc_module_name":57,"category_name":142,"show_sort_weight":22,"slug":143},"World Cup","world-cup",{"id":145,"doc_module":4,"doc_module_name":57,"category_name":146,"show_sort_weight":145,"slug":147},10,"Lifestyle","lifestyle",{"id":149,"doc_module":4,"doc_module_name":57,"category_name":150,"show_sort_weight":121,"slug":151},19,"General","general",{"list":153,"token":45},[154,160,166,172,178,184,191,197,203,209],{"doc_id":155,"doc_title":156,"file_type":18,"home_preview_img_url":157,"slug":158,"view_count":11,"category_name":12,"create_tm":159},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=1796111999&Signature=8NSxiPH2GSPijgEC62uPA3Jcllw%3D","basic-css-lecture-4-css-styling-fundamentals",1794468368,{"doc_id":161,"doc_title":162,"file_type":18,"home_preview_img_url":163,"slug":164,"view_count":11,"category_name":12,"create_tm":165},693037,"Cascading Style Sheets (CSS) - CS142 Lecture Notes - CSS 1 - Driving problem behind CSS","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230004257728/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=bKEhzavb4mMRJaDMluUHhxW4M7I%3D","cascading-style-sheets-css-cs142-lecture-notes-css-1-driving-problem-behind-css",1794246439,{"doc_id":167,"doc_title":168,"file_type":18,"home_preview_img_url":169,"slug":170,"view_count":121,"category_name":12,"create_tm":171},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=1796111999&Signature=WKx1GXY99zljcKwroKknQsdNau4%3D","internet-fundamentals-introduction-to-web-technologies-lecture-3-cascading-style-sheets",1794019250,{"doc_id":173,"doc_title":174,"file_type":18,"home_preview_img_url":175,"slug":176,"view_count":11,"category_name":12,"create_tm":177},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=1796111999&Signature=xkp1JaDDvbAiIou13vf00%2BgWpM8%3D","css-cascading-style-sheets-basic-css-properties-syntax-and-usage",1794468363,{"doc_id":179,"doc_title":180,"file_type":18,"home_preview_img_url":181,"slug":182,"view_count":60,"category_name":12,"create_tm":183},686721,"CSS - Applying Basic Styles","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230001090655/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=9u2kTIYmhKwAh7kMa3qSw1zFFnU%3D","css-applying-basic-styles",1794061500,{"doc_id":185,"doc_title":186,"file_type":18,"home_preview_img_url":187,"slug":188,"view_count":189,"category_name":12,"create_tm":190},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=1796111999&Signature=NoZoA5OZ6Cw0Z8s%2F39PTMuih3zs%3D","html-cheat-sheet-a-quick-guide-to-html-css-and-javascript-basics",21,1790849720,{"doc_id":192,"doc_title":193,"file_type":18,"home_preview_img_url":194,"slug":195,"view_count":133,"category_name":12,"create_tm":196},703167,"CSS From A To Z - Introduction to CSS - read online free","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230013426264/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=se%2F1vuy8LeGqsQMdJf5xHSxB5mg%3D","css-from-a-to-z-introduction-to-css-read-online-free",1794561915,{"doc_id":198,"doc_title":199,"file_type":18,"home_preview_img_url":200,"slug":201,"view_count":20,"category_name":12,"create_tm":202},699459,"Unit 3 - Cascading Style Sheets (CSS) - Lecture","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230011003387/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=brdp98BO9zrvHwCxh0UuJRHkaOk%3D","unit-3-cascading-style-sheets-css-lecture",1794468356,{"doc_id":204,"doc_title":205,"file_type":18,"home_preview_img_url":206,"slug":207,"view_count":20,"category_name":12,"create_tm":208},693040,"CSS Tutorial Part 1 - Introduction - Adding Style to a Web Page","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230005053964/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=wQopp5jYHaWSkM4hLU2RqBieRY8%3D","css-tutorial-part-1-introduction-adding-style-to-a-web-page",1794246453,{"doc_id":210,"doc_title":211,"file_type":18,"home_preview_img_url":212,"slug":213,"view_count":11,"category_name":12,"create_tm":214},685839,"DCA-04 Block 2 - WEB-DESIGN - Unit-3 - Getting Started With CSS","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000223066/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=A35ysAM%2ByEb7PdnzMQ6re4%2BtX4g%3D","dca-04-block-2-web-design-unit-3-getting-started-with-css",1794019251]