gpt4 book ai didi

html - 如何在居中图像周围放置文字?

转载 作者:太空狗 更新时间:2023-10-29 13:17:07 29 4
gpt4 key购买 nike

我正在尝试完成这样的事情:enter image description here

这似乎无法模仿上面居中的图像被文本包围的图像。我试过使用 float ,但缺少一些东西,我不知道是什么。

这就是我目前拥有的:

enter image description here

这是我的代码:

https://jsfiddle.net/eqs6e1db/

section{
text-align: center;
}

section p{
-webkit-column-count: 3;
-moz-column-count: 3;
-ms-column-count: 3;
-o-column-count: 3;
column-count: 3;
text-align: justify;
}

section article:first-child{
float: left;
}

section article:last-child{
float: right;
}

最佳答案

好吧,您无法实现真正您的布局。但是你可以稍微修改一下。

对于每一列,您可以设置一个间隔符、一个填充符和另一个间隔符。

第一个垫片从顶部预留空间,只是为了将填充物推到所需位置。填充物确实保留了空间。扩孔垫片会消耗剩余空间,因此我们转到另一列。

你需要在容器上设置一个高度

.base {
width: 100%;
height: 1000px;
-webkit-column-count: 3;
-moz-column-count: 3;
column-count: 3;
}


.pushtop {
background-color: rgba(200,0,0,0.2);
width: 10px;
height: 17%;
float: right;
clear: both;
}

.pushbottom {
background-color: rgba(200,0,0,0.2);
width: 10px;
height: calc(83% - 200px);
float: right;
clear: both;
}

.insert {
background-color: lightblue;
height: 200px;
clear: both;
margin: 0px 10px;
}
.insertleft {
width: 100px;
float: right;
}

.insertcenter {
width: 100%;
float: right;
}

.insertright {
width: 100px;
float: left;
}

.container {
width: 735px;
position: relative;
}

.image {
position: absolute;
border: solid blue 1px;
width: 485px;
height: 200px;
left: 123px;
top: 170px;
}
<div class="container">
<div class="image"></div>
<div class="base">

<div class="pushtop"></div>
<div class="insert insertleft"></div>
<div class="pushbottom"></div>
<div class="pushtop"></div>
<div class="insert insertcenter"></div>
<div class="pushbottom"></div>
<div class="pushtop"></div>
<div class="insert insertright"></div>
<div class="pushbottom"></div>
<p>Another 4-storey structure will soon be under construction to add new classrooms and laboratories for the High School and Grade School.</p>

<p> Part of the reason for this attention to the North Campus is to help FU’s marketing strategy for the high school in response to the implementation of the K to 12 Program. First, we want to attract more enrollees. Second, we invest in the facilities in our aim to increase not just the quality of our education but to boost our enrollment capacity from 700 students to 1500 students. And of Course, thanks to our new solar panel installation, we will also be providing all the new classrooms with air conditioning for those sweltering months.</p>

<p>Corporate Social Responsibility or CSR, as viewed by the University, should also have a significant space in the academe's achievements and obligations.</p>

<p>Estudio Damgo, for instance, is now on its third iteration of touching people's lives through sustainable and life-changing architecture. Its buildings and designs, since its first project in 2013, serve as prototype structures that cater to the various needs of society. The University sees Estudio Damgo as a catalyst for creating a transformed, more developed, and more meaningful way of living not just in Dumaguete but through out the Philippines. Read more about the current project here. (note to Entheos; link the word “here” to full Estudio Damgo article)</p>

<p>In terms of agriculture, FU's Aquaponics sets the example in the use of completely natural and organic farming techniques, which enhance not only the environment's safety but boost farmers' production capabilities and livelihood as well. Aquaponics provides agriculturists the answer to sustainable food production and a sustainable ecosystem for both fish and plants. For more specifics on our organic farm click here. (Note to Entheos: Link the word “here” to full organic farming article)</p>

<p>A forest and wildlife protection program called “Ayungon Forest Reserve” has also been pushed by the College of Arts and Sciences in partnership with local government units and the Department of the Environment and Natural Resources (DENR). The program calls for protecting the natural resources of the Reserve from causes of declining population, degradation of wildlife habitat, deterioration of soil and river quality, and the cave’s carrying capacity.</p>

<p>The College of Business Administration (CBA), on the other hand, is seriously pursuing a strong “Entrepreneurship Program” that caters to all levels of participants from students to MSMEs (Micro, Small, Medium Enterprises). In fact, the CBA in partnership with DTI will soon launch an “Entrep Hub”—a one-stop business center for start-up entrepreneurs—during the University Expo in which high school students will compete for the best business plan. The prize will be an Incubation Program for the winning plan to become a real business.</p>

<p>The University Expo, formerly the Digital Expo, of the College of Computer studies is a major University event that showcases innovative technology. The annual event, which includes robotic challenges, quiz bowls, film festivals, etc., is an avenue for students from different academic institutions to participate in and learn from the latest IT breakthroughs.</p>

<p>Barangay constituents also have the opportunity to learn computer skills such as basic PC operations, Internet use, word processing, spreadsheet and presentation through the university's Computer Literacy Program for adopted barangays.</p>

<p>Moreover, “The Queue” coffee shop, run by the College of Hospitality Management ‘s Culinary Arts students, draws customers from in and outside the campus because of its delicious food and beverages.</p>



</div>
</div>

请注意,填充物和间隔物元素不应可见。我已经给出了背景和宽度(在 push 元素的情况下),以便您可以看到它是如何工作的

关于html - 如何在居中图像周围放置文字?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29651754/

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