Table of Contents
Reply to the discussion (solution)
Home Web Front-end HTML Tutorial css style not working??Isn't the priority of id selector higher than element selector? _html/css_WEB-ITnose

css style not working??Isn't the priority of id selector higher than element selector? _html/css_WEB-ITnose

Jun 24, 2016 am 11:57 AM
doesn't work priority element Selector

Please see the code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>无标题文档</title><style type="text/css">div{display:inline;width:100px;height:100px;padding:0;margin:0;float:left;}#div0{ width::400px;height:200px; background-color:black;display:block;float:none;}.div1{ background-color:red;}.div2{ background-color:blue;}.div3{ background-color:yellow;}</style></head><body><div id="div0">  <div class="div1"> 1</div>  <div class="div2"> 2</div>  <div class="div3"> 3</div></div></body></html>
Copy after login

Rendering:

According to the definition of css, div1, div2, and div3 should all be arranged horizontally, right? Why is the rendering effect vertical? Please give me some advice


Reply to the discussion (solution)

Halo! There is an extra colon after width! So the css doesn’t work
This is the disadvantage of Dreamweaver not having code checking. Using VS, you can immediately see the error

I also saw that the width of the #div0 style has an extra colon.

Okay, no one wants to pick up the points? If not, they will all be sent upstairs

Statement of this Website
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

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 ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Spellcheck not working in Teams [Fixed] Spellcheck not working in Teams [Fixed] Mar 06, 2024 am 09:10 AM

We've started noticing that sometimes spellcheck stops working for Teams. Spell check is an essential tool for effective communication, and any attack on it can cause considerable disruption to workflow. In this article, we'll explore common reasons why spell check might not be working as expected, and how to restore it to its previous state. So, if spell check is not working in Teams, follow the solutions mentioned in this article. Why doesn't Microsoft spell check work? There may be several reasons why Microsoft spell check is not working properly. These reasons include incompatible language settings, disabled spell check function, damaged MSTeam or MSOffice installation, etc. Also, outdated MSTeams and MSOf

Detailed explanation of Linux process priority adjustment method Detailed explanation of Linux process priority adjustment method Mar 15, 2024 am 08:39 AM

Detailed explanation of the Linux process priority adjustment method. In the Linux system, the priority of a process determines its execution order and resource allocation in the system. Reasonably adjusting the priority of the process can improve the performance and efficiency of the system. This article will introduce in detail how to adjust the priority of the process in Linux and provide specific code examples. 1. Overview of process priority In the Linux system, each process has a priority associated with it. The priority range is generally -20 to 19, where -20 represents the highest priority and 19 represents

CSS transformation: how to achieve the rotation effect of elements CSS transformation: how to achieve the rotation effect of elements Nov 21, 2023 pm 06:36 PM

CSS transformation: How to achieve the rotation effect of elements requires specific code examples. In web design, animation effects are one of the important ways to improve user experience and attract user attention, and rotation animation is one of the more classic ones. In CSS, you can use the "transform" attribute to achieve various deformation effects of elements, including rotation. This article will introduce in detail how to use CSS "transform" to achieve the rotation effect of elements, and provide specific code examples. 1. How to use CSS’s “transf

How to use CSS to achieve an element's transparency gradient effect How to use CSS to achieve an element's transparency gradient effect Nov 21, 2023 pm 01:38 PM

How to use CSS to achieve the transparency gradient effect of elements In web development, adding transition effects to web page elements is one of the important means to improve user experience. The gradient effect of transparency can not only make the page smoother, but also highlight the key content of the element. This article will introduce how to use CSS to achieve the transparency gradient effect of elements and provide specific code examples. Using the CSS transition attribute To achieve the transparency gradient effect of an element, we need to use the CSS transition attribute. t

Operator precedence list in Go language, which operator has the highest precedence? Operator precedence list in Go language, which operator has the highest precedence? Jan 03, 2024 pm 04:59 PM

There are many operators in Go language, which are often used to perform various mathematical and logical operations. Each operator has its own precedence, which determines the order in which they are evaluated in an expression. This article will introduce you to the priority ranking of operators in the Go language and find out the operator with the highest priority. The operators in Go language are as follows in order from high to low precedence: parentheses: (). Parentheses are used to change the precedence order of operators. Parentheses in expressions are evaluated first. Unary operators: +, -, !. Unary operator means that only one

Use jQuery to determine the display state of elements Use jQuery to determine the display state of elements Feb 23, 2024 pm 09:24 PM

Use jQuery to determine whether an element is visible or not. In web development, we often encounter situations where we need to determine whether an element is visible. Judging and operating the visibility of elements can be easily achieved through jQuery. This article will introduce how to use jQuery to determine the visibility of elements, and provide specific code examples. jQuery's element visibility judgment methods In jQuery, you can use some specific methods to judge the visibility of elements. The most commonly used method is .is(':vis

How to check if an element contains an attribute value in jQuery? How to check if an element contains an attribute value in jQuery? Feb 28, 2024 pm 02:54 PM

In jQuery, we often need to check whether an element contains a specific attribute value. Doing this helps us perform actions based on the attribute values ​​on the element. In this article, I will introduce how to use jQuery to check whether an element contains a certain attribute value, and provide specific code examples. First, let's take a look at some common methods in jQuery to operate the attributes of elements: .attr(): used to get or set the attribute value of an element. .prop(): used to get or set the attribute value of an element

Deep understanding of process priority in Linux Deep understanding of process priority in Linux Mar 14, 2024 pm 09:36 PM

To deeply understand the process priority in Linux, specific code examples are required. In the Linux system, the priority of the process is a very important concept. By properly setting the priority of the process, you can effectively control the allocation of system resources and improve system performance. This article will delve into the concept of process priority in Linux and demonstrate and practice it through specific code examples. 1. The concept of process priority in Linux. In the Linux system, the priority range of a process is -20 to 19, where -20 represents the highest priority.

See all articles