gpt4 book ai didi

html - CSS 布局方法 : Rounded Corner not CSS3 & images along sides (not just corners)

转载 作者:行者123 更新时间:2023-11-28 13:33:34 24 4
gpt4 key购买 nike

  • 我需要制作具有最小宽度和最小高度但会扩展到浏览器大小的 80% 的 CSS 布局。
  • 主 div 将有圆 Angular (使用图像,因为不支持 CSS3)- 但是,在顶部和底部以及左侧和右侧的 Angular 之间也有图像。这也提供了投影效果。
  • 挑战在于,因为我有 position:relative 的 div,然后我的 Angular 是 position: absolute(此时一切都很好),但是我希望我的中间图像扩展以填充 Angular 之间的空间。除非这不能正常工作,否则它会延伸到 div 的末尾。
  • 我对一种全新的方法持开放态度,我在下面包含图像和代码,但可以随意使用代码解决问题,使用背景色而不是必须使用我的图像。

这是我想要实现的目标:

wireframe以下是容器的图像:

http://imgur.com/a/EVJgQ

这里是一些代码...

HTML:

<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div class="pageWrapper">
<div class="contentWrapper">
<span class="top-left"></span>
<span class="top-middle"></span>
<span class="top-right"></span>
<span class="bottom-left"></span>
<span class="bottom-middle"></span>
<span class="bottom-right"></span>
<div class="content">
<p>
Lorem ipsum dotor sit amet, consectetur adipiscing elit.
Ut viverra lectus vitae est ullamcorper a tempus est commodo.
Phasellus et pulvinar risus. Cras quis aliquet odio. Ut condimentum porta mi ultrices elementum.
Maecenas feugiat magna at tellus convallis congue. Aenean tincidunt rutrum varius. Aenean nec eros id odio dapibus faucibus.
Pellentesque blandit gravida erat id sodales. Etiam nunc odio, pharetra nec aliquam a, gravida at metus. Nullam dapibus vulputate blandit.
Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum ullamcorper lectus ut sapien scelerisque
vitae ullamcorper mauris venenatis.
</p>
</div>
</div>
</div>
</body>

CSS:

body {
background-color: #eeeee7;
}

.pageWrapper {
margin: 0px auto; /* centers the div horizontally */
min-width: 900px;
min-height: 430px;
height: 80%;
width: 80%;
background-color: red;
}

.contentWrapper {
position: relative; /* makes our corners absolute relative to our container not our browser window */
background-color: yellow;
height: 100%;
width: 100%;
padding-right: 34px;
padding-left: 34px;
padding-top: 155px;
}

.top-left,
.top-right {
position: absolute;
height: 155px;
width: 34px;
background-color: blue;
}

.bottom-left,
.bottom-right {
position: absolute;
height: 29px;
width: 34px;
}

.top-left {
top: 0;
left: 0;
background-image:url('images/cornerLeftTop.jpg');
}
.top-right {
top: 0;
right: 0;
background-image:url('images/cornerRightTop.jpg');
}
.bottom-left {
bottom: 0;
left: 0;
background-image:url('images/cornerBottomLeft.jpg');
}
.bottom-right {
bottom: 0;
right: 0;
background-image:url('images/cornerBottomRight.jpg');
}
.top-middle {
position: absolute;
top: 0;
left: 34px;
height: 155px;
width: 100%;
background-image:url('images/headerMiddle.jpg');
}

.bottom-middle {
position: absolute;
bottom: 0;
height: 29px;
width: 100%;
background-image:url('images/footerMiddle.jpg');
}

.middle-left {

}

.middle-right {

最佳答案

这对我有用,我仍在完善在

<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div class="pageWrapper">
<div class="contentWrapper">
<div class="headerMiddle">
</div>
<span class="top-left"></span>
<span class="top-right"></span>
<div class="contentRight">
</div>
<div class="contentLeft">
</div>
<div class="content">
<p>
Lorem ipsum dotor sit amet, consectetur adipiscing elit.
Ut viverra lectus vitae est ullamcorper a tempus est commodo.
Phasellus et pulvinar risus. Cras quis aliquet odio. Ut condimentum porta mi ultrices elementum.
Maecenas feugiat magna at tellus convallis congue. Aenean tincidunt rutrum varius. Aenean nec eros id odio dapibus faucibus.
Pellentesque blandit gravida erat id sodales. Etiam nunc odio, pharetra nec aliquam a, gravida at metus. Nullam dapibus vulputate blandit.
Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum ullamcorper lectus ut sapien scelerisque
vitae ullamcorper mauris venenatis.
</p>
<p>
Lorem ipsum dotor sit amet, consectetur adipiscing elit.
Ut viverra lectus vitae est ullamcorper a tempus est commodo.
Phasellus et pulvinar risus. Cras quis aliquet odio. Ut condimentum porta mi ultrices elementum.
Maecenas feugiat magna at tellus convallis congue. Aenean tincidunt rutrum varius. Aenean nec eros id odio dapibus faucibus.
Pellentesque blandit gravida erat id sodales. Etiam nunc odio, pharetra nec aliquam a, gravida at metus. Nullam dapibus vulputate blandit.
Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vestibulum ullamcorper lectus ut sapien scelerisque
vitae ullamcorper mauris venenatis.
</p>
</div>

<div class="footerMiddle">
</div>
<span class="bottom-left"></span>
<span class="bottom-right"></span>
</div>
</div>
</body>

body {
background-color: #eeeee7;
text-align:center;
}

.pageWrapper {
margin: 0px auto; /* centers the div horizontally */
min-width: 900px;
height: 768px;
width: 80%;
}

.contentWrapper {
position: relative; /* makes our corners absolute relative to our container not our browser window */
background-color: white;
height: 100%;
width: 100%;
padding-top: 155px;
text-align: left;
}

.content {
padding: 75px;
}

.headerMiddle {
position: absolute;
top: 0;
left: 0;
height: 155px;
width: 100%;
background-image:url('images/headerMiddle.jpg');
}

.footerMiddle {
position: absolute;
bottom: 0;
right: 0;
height: 29px;
width: 100%;
background-image:url('images/footerMiddle.jpg');
}

.contentLeft {
float: left;
height: 100%;
width: 34px;
background-image:url('images/contentLeft.jpg');
}

.contentRight {
float: right;
height: 100%;
width: 34px;
background-image:url('images/contentRight.jpg');
}

.top-left,
.top-right {
position: absolute;
height: 155px;
width: 34px;
background-color: blue;
}

.top-left {
top: 0;
left: 0;
background-image:url('images/cornerLeftTop.jpg');
}

.top-right {
top: 0;
right: 0;
background-image:url('images/cornerRightTop.jpg');
}

.bottom-left,
.bottom-right {
position: absolute;
height: 29px;
width: 34px;
}

.bottom-left {
bottom: 0;
left: 0;
background-image:url('images/cornerBottomLeft.jpg');
}
.bottom-right {
bottom: 0;
right: 0;
background-image:url('images/cornerBottomRight.jpg');
}

.minWidth {
width: 600px;
height:1px;
}

关于html - CSS 布局方法 : Rounded Corner not CSS3 & images along sides (not just corners),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13278193/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com