Centering an image link with HTML and no CSS

后端 未结 2 1263
误落风尘
误落风尘 2021-01-19 18:02

I am trying to center an image using only HTML and no CSS, is this possible? I have tried the following code:




        
2条回答
  •  無奈伤痛
    2021-01-19 18:32

    Well, you could use

    , but it is no longer supported. Your best bet here is to use the style attribute in HTML and text-align:center. This won't directly center the image, so you would wrap it in a div with the styling:

    
    

    After looking at a comment that was posted, I see that you actually don't need the div. Just apply it to the link around it.

    
    
    
    

    There is no possible way to do this without CSS, unless you want to use outdated stuff.

提交回复
热议问题