欧美一区二区三区,国内熟女精品熟女A片视频小说,日本av网,小鲜肉男男GAY做受XXX网站

為什么最小寬度不& # 39;不能在svg上工作,因為svg,段落的行為很奇怪?

黃文隆2年前8瀏覽0評論

為什么svg不改變它的寬度,但是段落卻改變了。 此外,為什么段落適合svg的寬度,而不是我的css文件中定義的寬度。 當我改變順序并將svg放在段落之后時,段落的寬度與我在css文件中的寬度相同。 https://jsfiddle.net/daotwLg3/

<style>
main{
background-color: lightblue;
max-width:600px;
padding:1rem;

}

main p{
margin: 1px auto;
background-color: white;
padding:1rem;
}

.rectangle{
  stroke-width:3;
  stroke:black;
  fill:black;
}

main svg{
  border:3px solid blue;
  max-width:600px;


}

main div{
  max-width:600px;
}

main p:nth-child(1){
  width:1000px;
}

main p:nth-child(2){
  max-width:800px;

}    
</style>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <link rel="stylesheet" href="test.css">
        <title>Modus Energy</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
        <main>

<div>
            <svg width="500px" height="500px" viewbox="0 0 500 500">
                <rect class="rectangle" x="250" y="250" width="100px" height="100px"></rect>
            </svg>
</div>
        <p>Notice that you're not naming lines with this syntax, just areas. When you use this syntax the lines on either end of the areas are actually getting named automatically. If the name of your grid area is foo, the name of the area's starting row line and starting column line will be foo-start, and the name of its last row line and last column line will be foo-end. This means that some lines might have multiple names, such as the far left line in the above example, which will have three names: header-start, main-start, and footer-start.</p>
        <p>Notice that you're not naming lines with this syntax, just areas. When you use this syntax the lines on either end of the areas are actually getting named automatically. If the name of your grid area is foo, the name of the area's starting row line and starting column line will be foo-start, and the name of its last row line and last column line will be foo-end. This means that some lines might have multiple names, such as the far left line in the above example, which will have three names: header-start, main-start, and footer-start.</p>


    </main>
<script>
</script>
</body>
</html>

你從不使用最小寬度。嘗試:

main svg
{
   border:3px solid blue;
   min-width: 600px;
}

也許這將有助于您,但是svg元素的最小/最大大小可以通過css函數max(& lt;最小值& gt,& lt值& gt)/分鐘(& lt值& gt,& lt最大值& gt)分別。

例如,對于rect元素的動態寬度,我是這樣做的:

寬度:max(6px,var(-width-percentage));