For example, if you want to display the following content in one line, what should you do? (Note: 1/2 needs to be written as a standard fraction, written in two lines, upper and lower)
"...Omit 30 words here...I want to enter a fraction: 1 1/2, what about this What to do? ...Omit 10 characters here..."
Let’s make a table. Just a few characters occupying one line is too wasteful and affects the layout. Let’s make a picture. It’s a bit more complicated. .
Are you paying attention?
Reply to discussion (solution)
You can try this idea
<!DOCTYPE html><html> <head> <meta charset="utf-8" /> <title></title> <style type="text/css"> .percent{ position: relative; } .percent span:nth-child(1){ border-bottom: 1px solid #000; position: absolute; top: -2px; } .percent span:nth-child(2){ position: absolute; top: 15px; } </style> </head> <body> <div class="percent"> <span>1</span> <span>2</span> </div> </body></html>
Branch using p tag
Thanks 2#, but my ie8 can’t be used.
Wrong writing, thanks to #1’s nth-child (ie8 cannot be used)
Branch uses p tag
Please give me an example, thank you.
In fact, it can be solved easily by using table. There is only one tr and td set valign="middle". When encountering a fraction, add a td and use
...
But there is a problem: p and table are all block elements and must occupy a separate line. They cannot stay on the same line as row elements (although they are inline, they are still not on the same horizontal line). When the expression to be displayed is very short (such as 1 1/2), it also occupies one line, which is too unsightly....
<!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><title> new document </title><style type="text/css">#ft { position: relative; top: 0.5em;}#fb { position: absolute; top: -1em; text-decoration: underline;}</style></head><body><br /><br />fffff 1+<span id="ft"><span id="fb">1</span>2</span> nnnnnnnnn</html></body></html>
To jslang:
It’s still a problem that 1/2 and 1/100 cannot share the same class! Centering has to be debugged one by one, obviously it won’t work...
To jslang:
It’s still a problem that 1/2 and 1/100 cannot share the same class! You still have to debug one by one to get it in the middle, obviously it won’t work...
<!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><title> new document </title><style type="text/css">.ft { position: relative; margin-right: 30px;}.fb { position: absolute; top: -0.5em; left: 0px; width: 30px; text-align: center; }.fm { position: absolute; top: 0.5em; left: 0px; width: 30px; text-align: center; border-top: 1px solid #000;}</style></head><body><br /><br /><br /><br />fffff 1+<span class="ft"><div class="fb">1</div><div class="fm">2</div></span>+<span class="ft"><div class="fb">1</div><div class="fm">100</div></span> nnnnnnnnn</body></html>
Okay, I’m convinced, I’ll give you extra points. It’s the end of the month and the end of the year. Happy New Year to everyone. .

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.

HTMLisnotaprogramminglanguage;itisamarkuplanguage.1)HTMLstructuresandformatswebcontentusingtags.2)ItworkswithCSSforstylingandJavaScriptforinteractivity,enhancingwebdevelopment.

HTML is the cornerstone of building web page structure. 1. HTML defines the content structure and semantics, and uses, etc. tags. 2. Provide semantic markers, such as, etc., to improve SEO effect. 3. To realize user interaction through tags, pay attention to form verification. 4. Use advanced elements such as, combined with JavaScript to achieve dynamic effects. 5. Common errors include unclosed labels and unquoted attribute values, and verification tools are required. 6. Optimization strategies include reducing HTTP requests, compressing HTML, using semantic tags, etc.

HTML is a language used to build web pages, defining web page structure and content through tags and attributes. 1) HTML organizes document structure through tags, such as,. 2) The browser parses HTML to build the DOM and renders the web page. 3) New features of HTML5, such as, enhance multimedia functions. 4) Common errors include unclosed labels and unquoted attribute values. 5) Optimization suggestions include using semantic tags and reducing file size.

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.


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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SublimeText3 Linux new version
SublimeText3 Linux latest version

SublimeText3 Chinese version
Chinese version, very easy to use

Atom editor mac version download
The most popular open source editor

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