search
HomeWeb Front-endCSS TutorialSummary of four ways to introduce css

Summary of four ways to introduce css

Jan 08, 2018 am 10:38 AM
cssSummarize

This article mainly shares with you a summary of four ways to introduce css. It has good reference value and I hope it will be helpful to everyone. Let’s follow the editor to take a look, I hope it can help everyone.

1. Inline reference: used directly on tags, but maintenance cost is high

style='font-size:16px;color:#000000'

2. External connection reference: css code is separated from html code, which facilitates code reuse

<link>

The content of the style.css file is as shown on the right:

.font{color:blue;font-size:12px;}

3. Internal reference: The page is clearer, but cannot be used by other pages

<style>
    .font{color:blue;font-size:12px;}
</style>

4. External import: Multiple stylesheets can be imported in one HTML file. Similar to the external link reference

, have you learned how to add

<style>
    @import url(&#39;./style/style.css&#39;);
</style>

to the head tag in the HTML file? Collect it if you find it useful.

Related recommendations:

Using css style nesting method in Dreamweaver web page production

What should you pay attention to when setting table CSS style

Use CSS styles to generate search, shopping cart and other icon styles

The above is the detailed content of Summary of four ways to introduce css. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Component-Level CMSsComponent-Level CMSsApr 12, 2025 am 11:09 AM

When a component lives in an environment where the data queries populating it live nearby, there is a pretty direct line between the visual component and the

Set Type on a Circle... with offset-pathSet Type on a Circle... with offset-pathApr 12, 2025 am 11:00 AM

Here's some legit CSS trickery from yuanchuan. There is this CSS property offset-path. Once upon a time, it was called motion-path and then it was renamed. I

What does 'revert' do in CSS?What does 'revert' do in CSS?Apr 12, 2025 am 10:59 AM

Miriam Suzanne explains in a Mozilla Developer video on the subject.

The Modern LoversThe Modern LoversApr 12, 2025 am 10:58 AM

I love stuff like this.

Multi-Thumb Sliders: General CaseMulti-Thumb Sliders: General CaseApr 12, 2025 am 10:52 AM

The first part of this two-part series detailed how we can get a two-thumb slider. Now we'll look at a general multi-thumb case, but with a different and

CSS-Only CarouselCSS-Only CarouselApr 12, 2025 am 10:48 AM

It's kind of amazing how far HTML and CSS will take you when building a carousel/slideshow.

The Web in 2020: Extensibility and InteroperabilityThe Web in 2020: Extensibility and InteroperabilityApr 12, 2025 am 10:46 AM

In the past few years, we’ve seen a lot of change and diversion in regard to web technologies. In 2020, I foresee us as a web community heading toward

A Web Component with Different HTML for Desktop and MobileA Web Component with Different HTML for Desktop and MobileApr 12, 2025 am 10:43 AM

Christian Schaefer has a great big write-up about dealing with web advertisements. The whole thing is interesting, first documenting all the challenges that

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use