CSS 目标链接的图像以及将多张图像放在一行中的最佳方法

标签 css image targeting

我是 CSS 和 html 的新手,我想知道您是否可以帮助我。 我正在尝试制作一个页面,人们可以在其中访问我的网站并在他们想要的任何平台上购物。我已经设法在 html 中创建了页面,但是我无法获得四个图像(正方形),如果你想这样调用它...以页面为中心。

这是HTML

    <!DOCTYPE html>


<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content= "width = device-width. initial-scale= 1"

    <!-- Links to other files -->

    <!-- Default Location -->

<base href= "http//home/makenna/Documents/Amazon Docs/Kittiesnmore Web Files"/>

<!-- Links to CSS Stylesheets -->
<link rel="CSS Stylesheet" type "text/css"href="sellpagestylesheet1.css"> <!-- This is the main style sheet -->


<title> Shop with us on your Favorite E-retailer's Website </title>

<body>

<div>

<h3> Shop with us on your favorite shopping platform! </h3>

</div>



< id= "all pics">
<a href= "http://kittiesnmore.com/index.php/shop/">
<img src="https://imgur.com/DTEzmL3.jpg" alt= "Shop on our Site" style= "width:500px; height:500px; border:5x; bordercolor:4C4646; align:center; bordercolor:00008B;" id= "kittiesnmoreLogo" > 
</a>



<a href= "https://www.amazon.com/s?marketplaceID=ATVPDKIKX0DER&me=A3O390GOKHZKJR&merchant=A3O390GOKHZKJR&redirect=true">
<img src="https://imgur.com/Icu5jwn.jpg"  alt="Shop our Amazon Inventory" style=" height=500px; width: 500px; height: 500 px; border: 5px;" id= "amazonLogo">
</a>




<p id="secondRow">
<a href= "http://www.ebay.com/sch/makennher-0/m.html?item=152544640003&rt=nc&_trksid=p2047675.l2562">
<img src="https://imgur.com/hNBGJwg.jpg" alt= "Shop our Ebay Inventory" style="width:500 px; height:500px; border: 5px;" id= "ebayLogo"> 
</a>




<a href= "https://kittiesnmore.myshopify.com/">
<img src="https://imgur.com/o1zeKZF.jpg" alt="Shop on our Shopify Store" style= "height:500px; width:500px; border:5px;" id="shopifyLogo">
</a>
</p>

这里是 CSS

<head>


<style>

#firstRow.kittiesnmoreLogo{

    *{font-family: "Arial Black" Gadget, sans-serif;}
    .website{ padding 10px 10px 10px 10px
    }

我想知道针对我创建的图像以执行上述操作的最佳方式,我应该对我包含它们的方式进行的任何改进,或者是否存在非常严重的错误。

另外,如果我的代码在本网站上的格式不正确,我深表歉意,我对如何制作代码块不是很熟悉>。<

最佳答案

你用什么软件写代码,你的代码有太多的语法错误。首先纠正所有这些,然后尝试使用它,

#menu {
    max-width: 700px;
    text-align: center;
    margin: auto;
}
#menu img {
    width: 150px;
}
<div id="menu">
<img class ="blog" src="http://s18.postimg.org/il7hbk7i1/image.png">
<img class ="music" src="http://s18.postimg.org/4st2fxgqh/image.png">
<img class ="projects" src="http://s18.postimg.org/sxtrxn115/image.png">
<img class ="bio" src="http://s18.postimg.org/5xn4lb37d/image.png">
</div>

关于CSS 目标链接的图像以及将多张图像放在一行中的最佳方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44038916/

相关文章:

html - 文本底部与图像完全对齐

javascript - 添加屏蔽输入 js 后悬停和焦点类的更改

c# - C# 中的 BitmapSource 对象出现问题

java - 图像存储即服务

css - 背景图像适合屏幕 IE10

css - 什么时候为 CSS3 开发是安全的

image - Flutter:显示来自 URI 字符串或文件对象的图像

jquery - 定位一个元素

windows - 如何定位多个Windows版本

css - 如何使用 CSS 定位 div 内的第一个链接?