Home > Web Front-end > HTML Tutorial > Please help. Is the image centered or stretched? _html/css_WEB-ITnose

Please help. Is the image centered or stretched? _html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:18:20
Original
1706 people have browsed it


  
     
       
       
       
     
   
页面设置 预览页面 保存页面




1. How to set the picture in the table to be placed in the center of the div;
2. How to set the background picture of the div to stretch horizontally instead of tile effect.


Reply to discussion (solution)

2. Can't
1. Isn't it three columns? Why is it still centered?

2. Can't
1. Isn't it three columns? Why is it still centered?


Now the effect is like this. I want to put the picture in the black box

What is the IE? Why does mine not have this problem? Guess:

table{ border-collapse:collapse;border-spacing:0}tr,td{margin:0;padding:0}
Copy after login

In addition, when adjusting the format, if there are problems, it is best to add borders to them (border: 1px solid #ddd);

How come I don’t have this problem? Guess :
XML/HTML code?12345678table{ border-collapse:collapse;border-spacing:0}tr,td{margin:0;padding:0}
In addition, when adjusting the format, if there are any problems, please So that they can all add borders (border: 1px solid #ddd);

Firefox browser

My firefox looks like this. Your situation does not appear

Mine Firefox looks like this. Your situation does not appear.

This is probably the cause.

a

{
display:block;
}
a#setpage:link,a#setpage:visited
{
background:url(image/designerimg/setpage- link.png);
}
a#setpage:hover{
background:url(image/designerimg/setpage-mouseover.png);
}
a#setpage:active{
background:url(image/designerimg/setpage-click.png);
}



His question

CSS code?1234a{ display:block ;}

His question

a{   display:block;}
Copy after login

If you remove this, the effect of changing the picture during the link process will not work. Does the hero have any clever tips? I'm a novice in CSS, I'm learning as I go, please give me some advice


Let's change the layout. Don't use tables. It's troublesome to watch.

CSS code?12345678910111213141516171819202122232425262728293031 3233343536373839404142434445