We can Link to a Style Sheet to an external style sheet to assign a set of formatting rules to our HTML5 File. We use the <link> tag to specify the filename and location of the style sheet. We can link multiple files to the same style sheet to give all the pages on your site a consistent look and feel. We can also assign multiple style sheets to a single document by adding more than one <link> tag. To learn how to create a style sheet.
Link To a style Sheet
Step 1: Open the HTML5 Document you want to link to the style sheet.
Step 2: Click within the <head> and </head> tags and add a new line.
Step 3: Type <link rel=”stylesheet” type = “text/css”.
To specifies that the linked content is a style sheet defined with CSS.
Step 4: Type a blank space and href=”?”> replacing? with the name of the style sheet file.
If the style sheet is located in a subdirectory, precede the file name with the subdirectory name and a slash for example css/style.css
The style sheet is now linked to the page.
We can test your page in a browser to see the style sheet results.
<!DOCTYPE html> <html> <Head> <Title>Coding thai</Title> <link rel="Stylesheet" type="text/css" href="style.css"> </Head> <body> <h1>Types of Web Developer</h1> <h2>Fontend Developer and Back-end Developer</h2> <hr> <p>A front end developer has one general responsibility: to ensure that website visitors can easily interact with the page. Back-end developers are the experts who build and maintain the mechanisms that process data and perform actions on websites.</p> <hr> <small> ©Copyright 2022 Codingthai</small> </body> </html>