Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.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
Css 流体-相对于其包装的水平和垂直对齐图像_Css - Fatal编程技术网

Css 流体-相对于其包装的水平和垂直对齐图像

Css 流体-相对于其包装的水平和垂直对齐图像,css,Css,在这里,我有一个深蓝色的包装内的图像,我希望它相对于包装水平和垂直对齐70% 我尝试使用表格单元格,但似乎不起作用 HTML: 这是你想要的吗 #wallet_logo_new_padding img { position: relative; width: 70%; margin-left: 15%; margin-right: 15%; } 谢谢你的帮助。我已经创作了小提琴,并做了一些修改- #menu_content { height:

在这里,我有一个深蓝色的包装内的图像,我希望它相对于包装水平和垂直对齐70%

我尝试使用
表格单元格
,但似乎不起作用

HTML:

这是你想要的吗

#wallet_logo_new_padding img
{
   position: relative;
   width: 70%;  
   margin-left: 15%;
   margin-right: 15%;
}

谢谢你的帮助。我已经创作了小提琴,并做了一些修改-
    #menu_content {
        height: 70%;
        width: 100%;
        position: relative;
        border: 0px solid blue;
    }
    #menu_wallet {
        overflow: hidden;
        height: 35%;
        width: 100%;
        display:table;
        background-color: #416DB4;
        width: 85%;
        margin-left: auto;
        margin-right: auto;
        border-radius: 0.3em;

    }

    #wallet_logo_new {
        display: table-cell;
        vertical-align: middle;
        width: 50%;

    }
    #wallet_logo_new_padding {
        position: relative;
        height: 70%;
        width: 70%;
        margin: auto;
        background-color: #1F58A5;
        border-radius: 5px;
        display: table;
    }
    #img_wallet_logo_new {
        //margin-top:15px;
        width: 20%;
        //height: 20%;
        //width: 60px;
        //height: 60px;    
        position: relative;

    }
    #wallet_txt {
        display: table-cell;
        vertical-align: middle;
        font-size: 3em;
        color: #FFFFFF;
        width: 50%;
    }
#wallet_logo_new_padding img
{
   position: relative;
   width: 70%;  
   margin-left: 15%;
   margin-right: 15%;
}