Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/69.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.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 对中<;a>;div中的按钮 我好像不能把我的按钮放在屏幕中间。_Html_Css - Fatal编程技术网

Html 对中<;a>;div中的按钮 我好像不能把我的按钮放在屏幕中间。

Html 对中<;a>;div中的按钮 我好像不能把我的按钮放在屏幕中间。,html,css,Html,Css,以下是JSFIDLE: 我不知道为什么按钮向左倾斜。我将左右边距设置为自动。我认为这可能是一个定位问题,但我尝试了相对定位和绝对定位,但没有效果 HTML: 影响元素的内联内容,而不是元素本身 您必须将样式移动到父级: 您可以添加 .row { text-align: center; } 将所有元素集中在一起 小提琴是空的也无济于事。我错了,给您带来不便,很抱歉。我全神贯注。 .welcome-text-container { /* z index --> stack o

以下是JSFIDLE:

我不知道为什么按钮向左倾斜。我将左右边距设置为自动。我认为这可能是一个定位问题,但我尝试了相对定位和绝对定位,但没有效果

HTML:

影响元素的内联内容,而不是元素本身

您必须将样式移动到父级

您可以添加

.row {
    text-align: center;
}
将所有元素集中在一起


小提琴是空的也无济于事。我错了,给您带来不便,很抱歉。我全神贯注。
.welcome-text-container {
    /* z index --> stack order, higher == top of stack*/
    z-index: 100;
    /* relative position moes an element RELATIVE to its original position
        ie: behind the image!
    */
    position: relative;
    padding-top: 300px;
    padding-bottom: 200px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.welcome-text1 {
    text-align: center;
    color: #FFF;
    font-size: 40px;
}

.welcome-text2 {
    text-align: center;;
    font-size: 75px;
    font-weight: 800;
    color: #FFF;
    padding-bottom: 25px;
}

.welcome-btn {
    text-align: center;
    background-color: #ecf9f8;
    font-weight: 400;
    font-size: 20px;
    padding-left: 40px;
    padding-right: 40px;
    position: relative;
}

.btn-row {
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

.row {
    padding-left: 50px;
    padding-right: 50px;
}
.btn-row {
    text-align: center;
    /* ... */
}
.row {
    text-align: center;
}