Home Web Front-end CSS Tutorial css: border-spacing attribute is not supported in IE6 IE7 IE8(Q)

css: border-spacing attribute is not supported in IE6 IE7 IE8(Q)

Jun 30, 2017 am 10:00 AM
border-spacing css

Standard Reference

TABLE's 'border-collapse' defines two modes of TD borders. When the value of 'border-collapse' is 'collapse', the borders of TD are merged. , when the value is 'separate', the TD border is separated.

'border-spacing' is a feature of TABLE in TD border-spacing mode. This property represents the distance between TD borders, or the horizontal and vertical space if only one length value is set. If you set two length values, the first value is the horizontal space and the second is the vertical space. The length value cannot be negative.

'cellspacing' As the attribute of the TABLE tag, you can also specify the distance between cells.

Detailed description of TABLE border mode in CSS2.1 specification: 17.6 Borders.

Detailed description of the 'border-spacing' feature in the CSS2.1 specification: 17.6.1 border-spacing.

Detailed description of 'cellspacing' in HTML 4.01 specification: 11.3.3 cellspacing.

Problem description

When the TD border mode in TABLE is detached mode, when 'border-spacing' is defined, IE6 IE7 IE8(Q) does not support this attribute, and other browsers comply with the specification.

Impact

When this attribute is set, this attribute is not supported in IE6 IE7 IE8(Q), resulting in page layout differences.

Affected browsers

IE6 IE7 IE8(Q)

Problem analysis

In TABLE, when TD border mode is detached mode, define' border-spacing' code is as follows:

<html>
<head>
<style type="text/css">
table{  border-collapse: separate;
  border: 1px solid red;  border-spacing:10px 20px;}
td{
  border: 1px dotted blue;
}
</style>
</head>
<body>
<table>
<tr>
  <td>aa</td>
  <td>bb</td>
</tr>
<tr>
  <td>cc</td>
  <td>dd</td>
</tr>
</table>
</body>
</html>

css: border-spacing attribute is not supported in IE6 IE7 IE8(Q)

is visible,

IE6 IE7 IE8(Q) does not support this attribute.

IE8(S) Firefox Chrome Safari Opera supports this attribute and complies with the specification.

So what is the difference in layout between cellspacing and border-spacing? Then analyze the following code:

<!DOCTYPE HTML>
<html>
<head>
<style type="text/css">
table{
  border: 1px solid red;
}
td{
  border: 1px dotted blue;
}
</style>
</head>
<body>
<table cellspacing=20>
<tr>
  <td>aa</td>
  <td>bb</td>
</tr>
<tr>
  <td>cc</td>
  <td>dd</td>
</tr>
</table>
</body>
</html>

The performance of each browser is consistent:

css: border-spacing attribute is not supported in IE6 IE7 IE8(Q)

It can be seen that cellspacing is equivalent to border-spacing in the horizontal and vertical directions. value.

Solution

'border-spacing' is not well supported by all browsers. If the horizontal and vertical spaces are equal, you can use the cellspacing attribute of TABLE instead of 'border-spacing' 'Characteristics.

The above is the detailed content of css: border-spacing attribute is not supported in IE6 IE7 IE8(Q). For more information, please follow other related articles on the PHP Chinese website!

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

Undress AI Tool

Undress AI Tool

Undress images for free

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.

ArtGPT

ArtGPT

AI image generator for creative art from text prompts.

Stock Market GPT

Stock Market GPT

AI powered investment research for smarter decisions

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 style a textarea with CSS How to style a textarea with CSS Sep 16, 2025 am 07:00 AM

First, set basic styles such as width, height, margins, borders, fonts and colors; 2. Enhance interactive feedback through:hover and:focus states; 3. Use the resize attribute to control the resize behavior; 4. Use the ::placeholder pseudo-element to style the placeholder text; 5. Use responsive design to ensure cross-device availability; 6. Pay attention to correlating labels, color contrast and focus outlines to ensure accessibility, and ultimately achieve a beautiful and functional textarea style.

How to use the pointer-events property in CSS How to use the pointer-events property in CSS Sep 17, 2025 am 07:30 AM

Thepointer-eventspropertyinCSScontrolswhetheranelementcanbethetargetofpointerevents.1.Usepointer-events:nonetodisableinteractionslikeclicksorhoverswhilekeepingtheelementvisuallyvisible.2.Applyittooverlaystoallowclick-throughbehaviortounderlyingelemen

How to prevent images from stretching or shrinking with CSS How to prevent images from stretching or shrinking with CSS Sep 21, 2025 am 12:04 AM

Useobject-fitormax-widthwithheight:autotopreventimagedistortion;object-fitcontrolshowimagesfillcontainerswhilepreservingaspectratios,andmax-width:100%;height:autoensuresresponsivescalingwithoutstretching.

How to create a dropdown menu with pure CSS How to create a dropdown menu with pure CSS Sep 20, 2025 am 02:19 AM

Use HTML and CSS to create drop-down menus without JavaScript. 2. Trigger the submenu display through the :hover pseudo-class. 3. Use nested lists to build a structure, and set the hidden and suspended display effects in CSS. 4. Transition animation can be added to improve the visual experience.

How to add a box shadow effect with CSS How to add a box shadow effect with CSS Sep 20, 2025 am 12:23 AM

Usethebox-shadowpropertytoadddropshadows.Definehorizontalandverticaloffsets,blur,spread,color,andoptionalinsetforinnershadows.Multipleshadowsarecomma-separated.Example:box-shadow:5px10px8pxrgba(0,0,0,0.3);createsasoftblackshadow.

How to add a gradient background in CSS How to add a gradient background in CSS Sep 16, 2025 am 05:30 AM

To add a CSS gradient background, use the background or background-image attributes to cooperate with functions such as linear-gradient(), radial-gradient(); first select the gradient type, set the direction and color, and you can finely control it through color docking points, shape, size and other parameters, such as linear-gradient(toright,#ff7e5f,#feb47b) to create a linear gradient from left to right, radial-gradient(circle,#ff9a9e,#fecfef) to create a circular radial gradient, and you can also use repeating-linear-gr

How to make text responsive with CSS How to make text responsive with CSS Sep 15, 2025 am 05:48 AM

TomaketextresponsiveinCSS,userelativeunitslikerem,vw,andclamp()withmediaqueries.1.Replacefixedpixelswithremforconsistentscalingbasedonrootfontsize.2.Usevwforfluidscalingbutcombinewithcalc()orclamp()topreventextremes.3.Applymediaqueriesatcommonbreakpo

How to create a circular image in CSS? How to create a circular image in CSS? Sep 15, 2025 am 05:33 AM

Use border-radius:50% to turn images of equal width and height into circles, combine object-fit and aspect-ratio to ensure shape and cropping, and add borders, shadows and other styles to enhance visual effects.

See all articles