Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何在网格库中居中放置缩略图,或将整个图像作为缩略图_Html_Css_Gallery - Fatal编程技术网

Html 如何在网格库中居中放置缩略图,或将整个图像作为缩略图

Html 如何在网格库中居中放置缩略图,或将整个图像作为缩略图,html,css,gallery,Html,Css,Gallery,正如你所看到的,图像被向左移动,我希望当你点击它时,它或者居中,或者整个图像,我将如何在CSS中实现它 我尝试使用display:inline块和display:block 在父元素上添加此样式以使其居中:0自动;最大宽度:800px;这将使元素在屏幕上居中,文本也将保留在左侧,但如果要使用文本对齐:居中;这将使所有内容都集中在该元素中。希望有帮助-阿基泰克

正如你所看到的,图像被向左移动,我希望当你点击它时,它或者居中,或者整个图像,我将如何在CSS中实现它


我尝试使用display:inline块和display:block

在父元素上添加此样式以使其居中:0自动;最大宽度:800px;这将使元素在屏幕上居中,文本也将保留在左侧,但如果要使用文本对齐:居中;这将使所有内容都集中在该元素中。希望有帮助-阿基泰克