简体   繁体   English

WordPress:徽标在小屏幕上的显示尺寸很小

[英]Wordpress: Logo gets on small screens a very small size

My logo has a normal size on the screen like this 我的徽标在屏幕上的大小是这样的

在此处输入图片说明

and if I change the screen-size of the browser then my logo gets very small. 如果更改浏览器的屏幕尺寸,则徽标会变得很小。

在此处输入图片说明

The logo mustn't have a small size like in the previous pictures. 徽标不能像上一张图​​片一样小。 It should be more like in the next picture: 下图应该更像:

在此处输入图片说明

I know there a lots of different themes but is it possible to keep the logo big by smallering the screen? 我知道有很多不同的主题,但是可以通过缩小屏幕来保持徽标较大吗?

Most WP themes have pre-set media queries that provide breakpoints to make the site responsive to screen size changes. 大多数WP主题都有预设的媒体查询,这些查询提供断点,以使站点能够响应屏幕尺寸的变化。

You can override these with custom CSS, but I'd find the breakpoint first. 您可以使用自定义CSS覆盖它们,但首先要找到断点。 Use this tool and then add something like the following to your CSS: 使用此工具 ,然后将以下内容添加到CSS:

@media screen and (max-width: 400px){
  .logo{
     width:200px !important;
 }
}

This changes the width of the logo when the screen size is 400px or smaller. 当屏幕尺寸为400px或更小时,这将更改徽标的宽度。 Change 400px to whatever value the breakpoint is set at. 将400px更改为设置断点的任何值。 You can edit width or height this way, but there's no need to do both unless you want to. 您可以通过这种方式来编辑宽度或高度,但是除非您愿意,否则无需同时进行这两项操作。

Edit: ".logo" in the CSS above should be changed to whatever the logo's class is. 编辑:上面的CSS中的“ .logo”应更改为徽标的类。

I am assuming you are using a theme and did not build this from scratch. 我假设您正在使用主题,而不是从头开始构建。 Chances are your theme has a responsive image declaration, such as: 您的主题很可能具有响应式图像声明,例如:

.someAwesomeDivName img {
    width:100%;
    height:auto;
}

and the parent div holding that image is a certain width, which effects the image inside it. 而持有该图片的父div具有一定的宽度,这会影响其中的图片。 Check there first, and go from there. 首先检查那里,然后从那里去。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM