HTML5 centered in the picture! ! ! ! ! ! ! Hyperlinks range overrun (overrun you think a)

1. Center the image display

Shit yeah feel quite interesting, engaging, the results will not be even a picture is centered. . . . . Own summarize it:

Himself wrote a page in the local test it, first of all look at what the effect is not centered when it:

To be honest, a little uncomfortable. Then go to Baidu a variety of programs, but awkward to use, only one kind! ! ! Look at renderings:

Ha ha ha ha ha ha! Cool. Really cool ~ ~ ~ ~

Code is actually very simple!

In fact, in one sentence, <p> tag align = "center": personally think that is really easy to use!

<p align="center"><img src="photo1.png" /></p>

2. links beyond the expected range

I am back again!

Just suddenly I found a small problem. Copy the code above First put it down:

<a href="https://www.csdn.net/" target="blank"><p align="center"><img class="photo1" src="photo1.png" /></p></a>
    <a href="https://yys.163.com/index.html" target="blank"><p align="center"><img class="photo2" src="photo2.jpg" /></p></a>

These two lines are this: <a 超级链接> <p centered> <img /> format such </ p> </a> eventually leads to a problem!

Your original idea was to set up a hyperlink Click on the image to achieve, but now you click on the line where the picture is not the picture position, it will also implement a hyperlink ...... This is not good.

Very simple ah ~ ~ ~ switched in the following order

<p align="center"><a href="https://www.csdn.net/" target="blank"><img class="photo1" src="photo1.png" /></a></p>
    <a href="https://yys.163.com/index.html" target="blank"><p align="center"><img class="photo2" src="photo2.jpg" /></p></a>

The first and second rows in contrast, you can try, but to write their own code Yup, I'm just here from my own part of the interception. Han did not begin with stickers over.

Published 77 original articles · won praise 7 · views 9091

Guess you like

Origin blog.csdn.net/qq_41886231/article/details/98494874