相关疑难解决方法(0)

box-sizing:border-box => for IE8?

我想box-sizing: border-boxdiv标签.

对于Mozila Firefox,我试过了

        -moz-box-sizing: border-box; 
Run Code Online (Sandbox Code Playgroud)

对于IE(Internet Explorer),我已经尝试过以下两种方式

        -ms-box-sizing: border-box; 
            box-sizing: border-box;
Run Code Online (Sandbox Code Playgroud)

但它无法在IE(Internet Explorer)中运行.虽然我申请 box-sizing: border-box;Internet Explorer,但它增加了边框和填充元素的宽度.为什么会这样?

应该是什么问题?请帮助和消化我.

注意:我使用的是Internet Explorer8Windows7终极版

页面代码:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MainPage.aspx.cs" Inherits="MainPage" %>

<!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 runat="server">
<meta http-equiv="x-ua-compatible" content="IE=8"/>

    <title></title>
    <style type="text/css">
        *
        {
            box-sizing: border-box; /*it gives error:Validation (CSS 2.1): 'box-sizing' is not a known CSS property name. …
Run Code Online (Sandbox Code Playgroud)

html css internet-explorer css3 internet-explorer-8

19
推荐指数
3
解决办法
5万
查看次数

标签 统计

css ×1

css3 ×1

html ×1

internet-explorer ×1

internet-explorer-8 ×1