gpt4 book ai didi

html - 如何通过html或css横向显示链接图片

转载 作者:行者123 更新时间:2023-11-28 04:08:47 24 4
gpt4 key购买 nike

对于我正在尝试创建的示例网站,我正在尝试水平而不是垂直显示社交媒体...无论如何我可以通过我的代码做到这一点吗?

如果您需要,我可以包含图片文件,但我不确定如何通过堆栈做到这一点

.fill-screen {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
text-align: center;
}

.make-it-fit {
max-width: 99%;
max-height: 99%;
}


@font-face {
font-family: 'Poppins', sans-serif;
font-family: 'Josefin Slab', serif;
}

body {
background-color: #f9f9f9;
}

fieldset {
margin-top: 1em;
margin-bottom: 1em;
padding: .5em;
}
legend {
color: blue;
font-weight: bold;
font-size: 85%;
margin-bottom: .5em;
}
label {
float: left;
width: 90px;
}
input, select {
margin-left: 1em;
margin-right: 1em;
margin-bottom: .5em;
}
input {
width: 14em;
}
input[type="radio"], input[type="checkbox"] {
width: 1em;
padding-left: 0;
margin-right: 0.5em;
}
<!DOCTYPE html>
<!--bakhriddinov-->
<!-- -->
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Final Project</title>
<script src="index.js"></script>
<link href="index.css" rel="stylesheet" type="text/css" />

<!--font-->
<link href="https://fonts.googleapis.com/css?family=Poppins" rel="stylesheet">

<link href="https://fonts.googleapis.com/css?family=Josefin+Slab" rel="stylesheet">

</head>
<body>
<!--significant element 1 DIV-->
<div class='fill-screen' style = "overflow: auto; max-height: 100vh;">
<h2><a id="top"></a></h2>
<img src="takethejourney.png" alt="next" height="70"/>

<br>

<!--significant element 2 IMAGES-->
<a href="index2.html">
<img src="savetheb.gif" alt="MAIN" height="400"/>
</a>
<br>
<br>

<!--significant element 4 LINKS TO OTHER INNER HTML-->
<a href="">
<img class='make-it-fit'
src=''>
</a>


<!-- social medias -->
<p></p>

<!--significant element 4 LINKS TO OTHER OUTER HTML-->
<a href="https://www.facebook.com/greenpeace.international?fref=ts">
<img src="64x64facebook.png" alt="greenpeace's facebook" height="20" width="20"/>
</a>

<p></p>

<a href="https://twitter.com/Greenpeace">
<img src="64x64twitter.png" alt="greenpeace's twitter" height="20" width="20"/>
</a>

<p></p>

<a href="https://www.youtube.com/user/GreenpeaceVideo">
<img src="64x64youtube.png" alt="greenpeace's youtube" height="20" width="20"/>
</a>

<p></p>

<a href="http://www.greenpeace.org/">
<img src="greenpeace_logo.png" alt="greenpeace" height="20"/>
</a>

<p></p>
</div>
</body>
</html>

谢谢

最佳答案

让图像并排显示而不需要太多改变的最简单方法是将它们简单地包装在一个容器中 <div> .它甚至不需要任何样式!

.fill-screen {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
text-align: center;
}

.make-it-fit {
max-width: 99%;
max-height: 99%;
}

@font-face {
font-family: 'Poppins', sans-serif;
font-family: 'Josefin Slab', serif;
}

body {
background-color: #f9f9f9;
}

fieldset {
margin-top: 1em;
margin-bottom: 1em;
padding: .5em;
}

legend {
color: blue;
font-weight: bold;
font-size: 85%;
margin-bottom: .5em;
}

label {
float: left;
width: 90px;
}

input,
select {
margin-left: 1em;
margin-right: 1em;
margin-bottom: .5em;
}

input {
width: 14em;
}

input[type="radio"],
input[type="checkbox"] {
width: 1em;
padding-left: 0;
margin-right: 0.5em;
}
<body>
<!--significant element 1 DIV-->
<div class='fill-screen' style="overflow: auto; max-height: 100vh;">
<h2>
<a id="top"></a>
</h2>
<img src="takethejourney.png" alt="next" height="70" />

<br>

<!--significant element 2 IMAGES-->
<a href="index2.html">
<img src="savetheb.gif" alt="MAIN" height="400" />
</a>
<br>
<br>

<!--significant element 4 LINKS TO OTHER INNER HTML-->
<a href="">
<img class='make-it-fit' src=''>
</a>


<!-- social medias -->
<div>

<!--significant element 4 LINKS TO OTHER OUTER HTML-->
<a href="https://www.facebook.com/greenpeace.international?fref=ts">
<img src="http://placehold.it/100" alt="greenpeace's facebook" height="20" width="20" />
</a>

<a href="https://twitter.com/Greenpeace">
<img src="http://placehold.it/100" alt="greenpeace's twitter" height="20" width="20" />
</a>

<a href="https://www.youtube.com/user/GreenpeaceVideo">
<img src="http://placehold.it/100" alt="greenpeace's youtube" height="20" width="20" />
</a>

<a href="http://www.greenpeace.org/">
<img src="http://placehold.it/100" alt="greenpeace" height="20" />
</a>

</div>

div 是一个 block元素,因此默认情况下将占据父元素宽度的 100%。图片是inline-block , 因此在 block 内时将尝试并排显示元素。

希望对您有所帮助! :)

关于html - 如何通过html或css横向显示链接图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42824473/

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