I have always been puzzled by this issue. According to the definition of CSS, it is not possible to set the width and height of inline (inline) elements, but what about the input of Shenma, which is an inline element? Can any expert explain it?
Reply to the discussion (solution)
Good morning,
That means input is not an inline (inline) element. Is it an inline element? Completely You can switch it through the CSS definition
Use firebug to see if it is an inline element. I used to take it for granted that input is an inline-block, but today I discovered that it turns out to be a living inline element. Element, why can the width of this product be set? Why is this?
I accidentally discovered an interesting problem during a certain layout. The previous concept was that is an inline element, and the width and height of inline elements cannot be determined. But obviously can be given width and height. Why? To understand, first we need to understand the inline-block attribute. Please click here to view: inline-block attribute. In fact, it is very simple. The inline-block attribute means that the outside of the element is an inline element, and the inside is indeed a block-level element, and has a natural inline-block attribute. This explains it easily. The element does not start a new line because its outer part is an inline element, but it can have a fixed width and height because its inner part is a block-level element. So when talking about inline elements and block-level elements, you must understand as a special case. ..
This is someone’s explanation. . .
It can be understood roughly like this:
Inline (inline) elements are called inline elements that can be displayed in the same line as other sibling elements relative to the left and right elements. For data display classes only For elements such as span, it is estimated that the width and height cannot be set. For input elements, such as input, the height can be set. . . It seems that it should be understood this way,
I accidentally discovered an interesting problem during a certain layout. The previous concept was that is an inline element, and the width and height of inline elements cannot be determined. But obviously can be given width and height. Why? To understand, first we need to understand the inline-block attribute. Please click here to view: inline-block attribute. In fact, it is very simple. The inline-block feature means that the outside of the element is an inline element, and the inside is indeed a block-level element. And is naturally inline-blo... This is how I understood it before, but. . You'd better use firebug to see it yourself. .
I understand what are inline elements and what are block-level elements, please don’t teach me about them. .
Well, after testing, it turns out that this is a firefox bug. .
<!doctype><html><head> <style> </style></head><body> <input type="text" value="text" id="input"/> <script> var input = document.getElementById('input'), input_style = window.getComputedStyle ? window.getComputedStyle(input, null) : input.currentStyle; alert(input_style.display); </script></body></html>In other browsers, input's display=inline-block; in Firefox, it is inline. . But I have another question. Inline-block is not supported in IE6. Can anyone with IE6 help me test it?
This is how it is stipulated.
The width of the inline element button img can be set. . . How to explain
Well, after testing, it turns out that this is a firefox bug. . JScript code

Boolean attributes are special attributes in HTML that are activated without a value. 1. The Boolean attribute controls the behavior of the element by whether it exists or not, such as disabled disable the input box. 2.Their working principle is to change element behavior according to the existence of attributes when the browser parses. 3. The basic usage is to directly add attributes, and the advanced usage can be dynamically controlled through JavaScript. 4. Common mistakes are mistakenly thinking that values need to be set, and the correct writing method should be concise. 5. The best practice is to keep the code concise and use Boolean properties reasonably to optimize web page performance and user experience.

HTML code can be cleaner with online validators, integrated tools and automated processes. 1) Use W3CMarkupValidationService to verify HTML code online. 2) Install and configure HTMLHint extension in VisualStudioCode for real-time verification. 3) Use HTMLTidy to automatically verify and clean HTML files in the construction process.

HTML, CSS and JavaScript are the core technologies for building modern web pages: 1. HTML defines the web page structure, 2. CSS is responsible for the appearance of the web page, 3. JavaScript provides web page dynamics and interactivity, and they work together to create a website with a good user experience.

The function of HTML is to define the structure and content of a web page, and its purpose is to provide a standardized way to display information. 1) HTML organizes various parts of the web page through tags and attributes, such as titles and paragraphs. 2) It supports the separation of content and performance and improves maintenance efficiency. 3) HTML is extensible, allowing custom tags to enhance SEO.

The future trends of HTML are semantics and web components, the future trends of CSS are CSS-in-JS and CSSHoudini, and the future trends of JavaScript are WebAssembly and Serverless. 1. HTML semantics improve accessibility and SEO effects, and Web components improve development efficiency, but attention should be paid to browser compatibility. 2. CSS-in-JS enhances style management flexibility but may increase file size. CSSHoudini allows direct operation of CSS rendering. 3.WebAssembly optimizes browser application performance but has a steep learning curve, and Serverless simplifies development but requires optimization of cold start problems.

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

The roles of HTML, CSS and JavaScript in web development are: HTML is responsible for content structure, CSS is responsible for style, and JavaScript is responsible for dynamic behavior. 1. HTML defines the web page structure and content through tags to ensure semantics. 2. CSS controls the web page style through selectors and attributes to make it beautiful and easy to read. 3. JavaScript controls web page behavior through scripts to achieve dynamic and interactive functions.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

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.

Dreamweaver CS6
Visual web development tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Linux new version
SublimeText3 Linux latest version

SublimeText3 Mac version
God-level code editing software (SublimeText3)
