


Newcomer asked: The display effects of different sizes of monitors in HTML are different. How to solve the problem? _html/css_WEB-ITnose
I just learned web design. When I was learning HTML, I made a page and put pet information on it. However, it looks normal on a 14.6-inch notebook, but distorted when viewed on a 19-inch monitor.
If it is corrected, it will look normal on a 19-inch monitor, but it will look awkward when you hold it on a laptop. Is there any function or label that can automatically change the size as the monitor changes?
The code is as follows:
<html> <head> <title>我的宠物</title> </head> <body bgcolor="#cyan"> <p> <img src="image/1.png" width="400" height="200"> <!--这里放入一个banner--> </p> <br> <h2><p>Jerry</p></h2> <!--现在可以放入一张宠物的图像,使之右对齐--> <p> <img src="image/宠物猫.jpg" width="500" height="381" border="4" align="right"/> </p> <p> 年龄:1.2岁<br> 最喜爱的食物:鱼,热狗<br> 特点:好动,活泼,上房下梁<br> <!--插入一条华丽的分割线--> <hr align="left" width="800" size="3" color="red"> <p align=center>更新宠物日志:</p> <!--再来一条华丽的分割线--> <hr align="left" width="800" size="3" color="red"> 2014年12月20号:<br> 今天的天气很好,所以带jerry去鱼梁河钓鱼,一路上,看到美丽的田边开满了<br> 花儿,天边的云,映着彩霞的分红,好美一副景象。 </p> </body></html>
The screenshot of the effect is as follows:
Reply to discussion (solution)
Sorry, the two pictures above are the effect of laptop. I put the wrong picture. The following is the effect of 19 monitor:
Try not to set w and h to fixed values. Instead, it is set as a percentage.
align="right"
The effect of this is that HTML and CSS are now separated. Your writing method is not good and is outdated. You should learn more about CSS.
Width and height should be proportional
Try to use % for width;
@media screen and (max-width: 480px){
}
@media screen and (max-width: 960px){
}
or define the style separately
align="right"
For this effect, html and css are now used Separate, your way of writing is not good and is outdated. You should learn more about CSS.
Try to use % for width;
@media screen and (max-width: 480px){
}
@media screen and (max-width: 960px) {
}
Or define the style separately
The traditional method is to center the outermost fixed-width box and leave backgrounds on the left and right.
You can also use responsive layout, use percentages for simple layouts, and use CSS3 media queries to restyle the complex ones.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati

HTML is suitable for beginners because it is simple and easy to learn and can quickly see results. 1) The learning curve of HTML is smooth and easy to get started. 2) Just master the basic tags to start creating web pages. 3) High flexibility and can be used in combination with CSS and JavaScript. 4) Rich learning resources and modern tools support the learning process.

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

The article discusses the viewport meta tag, essential for responsive web design on mobile devices. It explains how proper use ensures optimal content scaling and user interaction, while misuse can lead to design and accessibility issues.

The article discusses the <iframe> tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.

HTML defines the web structure, CSS is responsible for style and layout, and JavaScript gives dynamic interaction. The three perform their duties in web development and jointly build a colorful website.

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.
