Html display inline-block 问题_html/css_WEB-ITnose
我想用html+CSS 实现图上功能,于是用了inline-block。图中文字分为4块,问题是我输入的文字在同一块中无法换行,一旦我用
,就会文字不出现,代码如下:
Singapore
53 Cantonment Road #02-00
Malaysia
Suite 2A-5-1, Block 2A, Plaza Sentral
12, place de La Défense
Maison de La Défense
Room 315, Kim Nam Venture Building
Binjiang District
回复讨论(解决方案)
不好意思,代码贴错了,下面是我用的代码
Singapore
53 Cantonment Road #02-00
Malaysia
Suite 2A-5-1, Block 2A, Plaza Sentral
12, place de La Défense
Maison de La Défense
Room 315, Kim Nam Venture Building
Binjiang District
试一试
,如果还是不行的话,估计是你的盒太小了,把你的CSS贴出来看看。
试一试
,如果还是不行的话,估计是你的盒太小了,把你的CSS贴出来看看。box够大,我试了,还是不行:
为什么不用display:table- cell和display:table-row
试一试
box够大,我试了,还是不行:
在我这里试都是正常的,文字是可以换行的,只是你的块1,块2...没有样式,所以没有达到你所发图的那种效果。我用楼上的方法给你写个demo吧。
<!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8"> <title>Carousel Template · Bootstrap</title> <style type="text/css"> .box{ width: 700px; height: 300px; border: 1px solid gray; } tr{ height:100px; text-align: left; } td{ width:350px; } </style> </head> <body> <div class="box"> <table> <tr> <th>Contact Us</th> </tr> <tr> <td> Singapore<br> 53 Cantonment Road #02-00<br> </td> <td> Malaysia<br> Suite 2A-5-1, Block 2A, Plaza Sentral<br> </td> </tr> <tr> <td> 12, place de La Défense<br> Maison de La Défense<br> </td> <td> Room 315, Kim Nam Venture Building<br> Binjiang District<br> </td> </tr> </table> </body></html>
谢谢楼上两位,用table-cell 也可以写出来了。
CSS 部分:
。。。。。。。
.table{
display:table;
width:1300px;
margin:0 auto;
text-align:center;
}
.office-location{
display:table-cell;
*display:inline-block;
width:1000px;
*width:auto;
}
。。。。。
...

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

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

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

Hot Topics



HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process.

The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex

AnexampleofastartingtaginHTMLis,whichbeginsaparagraph.StartingtagsareessentialinHTMLastheyinitiateelements,definetheirtypes,andarecrucialforstructuringwebpagesandconstructingtheDOM.

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

GiteePages static website deployment failed: 404 error troubleshooting and resolution when using Gitee...
