Home Web Front-end JS Tutorial js control CSS style attribute syntax comparison table_basic knowledge

js control CSS style attribute syntax comparison table_basic knowledge

May 16, 2016 pm 05:47 PM
grammar

CSS and JS work closely together to add many unique effects to our pages. In order to achieve some special effect, we need to use Javascript to dynamically change the CSS properties of a certain tag.

For example, it is commonly used to turn off a floating advertisement display: document.getElementById('ad').style.display='none'; Equivalent to: .ad{ display:none}.

The following is the syntax comparison of JS controlling CSS style sheet

CSS语法 (不区分大小写) JavaScript语法 (区分大小写
border border 
border-bottom borderBottom 
border-bottom-color borderBottomColor 
border-bottom-style borderBottomStyle 
border-bottom-width borderBottomWidth 
border-color borderColor 
border-left borderLeft 
border-left-color borderLeftColor 
border-left-style borderLeftStyle 
border-left-width borderLeftWidth 
border-right borderRight 
border-right-color borderRightColor 
border-right-style borderRightStyle 
border-right-width borderRightWidth 
border-style borderStyle 
border-top borderTop 
border-top-color borderTopColor 
border-top-style borderTopStyle 
border-top-width borderTopWidth 
border-width borderWidth 
clear clear 
float floatStyle 
margin margin 
margin-bottom marginBottom 
margin-left marginLeft 
margin-right marginRight 
margin-top marginTop 
padding padding 
padding-bottom paddingBottom 
padding-left paddingLeft 
padding-right paddingRight 
padding-top paddingTop
background background 
background-attachment backgroundAttachment 
background-color backgroundColor 
background-image backgroundImage 
background-position backgroundPosition 
background-repeat backgroundRepeat 
color color 
display display 
list-style-type listStyleType 
list-style-image listStyleImage 
list-style-position listStylePosition 
list-style listStyle 
공백 화이트스페이스
글꼴 글꼴
글꼴군 fontFamily 
글꼴 크기 글꼴 크기 
글꼴 스타일 글꼴 스타일 
글꼴 변형 fontVariant
글꼴 두께 글꼴 가중치
자간 문자 간격 
줄 바꿈 lineBreak
줄 높이 라인 높이 
텍스트 정렬 textAlign 
텍스트 장식 텍스트 장식 
텍스트 들여쓰기 textIndent
텍스트 양쪽 정렬 textJustify 
텍스트 변환 텍스트 변환 
세로 정렬 세로정렬
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)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 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)

How to quickly turn your Python code into an API How to quickly turn your Python code into an API Apr 14, 2023 pm 06:28 PM

When it comes to API development, you may think of DjangoRESTFramework, Flask, and FastAPI. Yes, they can be used to write APIs. However, the framework shared today allows you to convert existing functions into APIs faster. It is Sanic . Introduction to Sanic Sanic[1] is a Python3.7+ web server and web framework designed to improve performance. It allows the use of the async/await syntax added in Python 3.5, which can effectively avoid blocking and improve response speed. Sanic is committed to providing a simple and fast way to create and launch

New type alias syntax in PHP8.0 New type alias syntax in PHP8.0 May 14, 2023 pm 02:21 PM

With the release of PHP 8.0, a new type alias syntax has been added, making it easier to use custom types. In this article, we'll take a closer look at this new syntax and its impact on developers. What is a type alias? In PHP, a type alias is essentially a variable that references the name of another type. This variable can be used like any other type and declared anywhere in the code. The main function of this syntax is to define custom aliases for commonly used types, making the code easier to read and understand.

What are the syntax and structure characteristics of lambda expressions? What are the syntax and structure characteristics of lambda expressions? Apr 25, 2024 pm 01:12 PM

Lambda expression is an anonymous function without a name, and its syntax is: (parameter_list)->expression. They feature anonymity, diversity, currying, and closure. In practical applications, Lambda expressions can be used to define functions concisely, such as the summation function sum_lambda=lambdax,y:x+y, and apply the map() function to the list to perform the summation operation.

The connection and difference between Go language and JS The connection and difference between Go language and JS Mar 29, 2024 am 11:15 AM

The connection and difference between Go language and JS Go language (also known as Golang) and JavaScript (JS) are currently popular programming languages. They are related in some aspects and have obvious differences in other aspects. This article will explore the connections and differences between the Go language and JavaScript, and provide specific code examples to help readers better understand these two programming languages. Connection: Both Go language and JavaScript are cross-platform and can run on different operating systems.

Parent class calling syntax in PHP8.0 Parent class calling syntax in PHP8.0 May 14, 2023 pm 01:00 PM

PHP is a server-side scripting language widely used in Web development, and PHP8.0 version introduces a new parent class calling syntax to make object-oriented programming more convenient and concise. In PHP, we can create a parent class and one or more subclasses through inheritance. Subclasses can inherit the properties and methods of the parent class, and can modify or extend their functionality by overriding the methods of the parent class. In ordinary PHP inheritance, if we want to call the method of the parent class in the subclass, we need to use the parent keyword to refer to the parent

Analysis of confusing concepts in C++ syntax Analysis of confusing concepts in C++ syntax Jun 01, 2024 pm 09:13 PM

Analysis of confusing concepts: pointers and references: pointers store variable addresses, and references point directly to variables. Pass by value and pass by reference: copy by value, reference by reference. const and constexpr: const is a run-time constant, and constexpr is a compile-time constant. && and &: && and &&& are logical AND operators, and & is a reference operator.

Learn the basic syntax of using CSS selectors Learn the basic syntax of using CSS selectors Jan 13, 2024 am 11:44 AM

To master basic CSS selector syntax, specific code examples are required. CSS selectors are a very important part of front-end development. They can be used to select and modify various elements of HTML documents. Mastering basic CSS selector syntax is crucial to writing efficient stylesheets. This article will introduce some common CSS selectors and corresponding code examples. Element selector The element selector is the most basic selector, which can select the corresponding element by its tag name. For example, to select all paragraphs (p elements), you can use

The usage and syntax of exponentiation operation in C language The usage and syntax of exponentiation operation in C language Feb 18, 2024 pm 04:05 PM

Introduction to the syntax and usage of power operation in C language: In C language, power operation (poweroperation) is a common mathematical operation, which is used to calculate the power of a number. In C language, we can use standard library functions or custom functions to implement exponentiation operations. This article will introduce the syntax and usage of exponentiation operation in C language in detail, and provide specific code examples. 1. Use the pow() function in math.h. In C language, the pow() function is provided in the math.h standard library for executing

See all articles