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
Html 如何将文本居中放置在白色区域内?_Html_Css - Fatal编程技术网

Html 如何将文本居中放置在白色区域内?

Html 如何将文本居中放置在白色区域内?,html,css,Html,Css,我添加了bodyclass容器,但可能我将div放在了底部的错误位置 <title>Where in the world is the sun rising and setting right now</title> <?php $con = mysql_connect("*****","*****","*****"); if (!$con) { die('Could not connect:

我添加了bodyclass容器,但可能我将div放在了底部的错误位置

<title>Where in the world is the sun rising and setting right now</title>

<?php 

     $con = mysql_connect("*****","*****","*****");
        if (!$con)
        {
            die('Could not connect: ' . mysql_error());
        }

    mysql_select_db("sunsetimges", $con);
?>
<head>
<title>Where in the world is the sun rising and setting right now</title>
<link rel="stylesheet" href="css/prettyPhoto.css" type="text/css" />
<link rel="stylesheet" href="css/flexslider.css" type="text/css" />
<link rel="stylesheet" href="css/style.css" type="text/css" />


<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/all-in-one-min.js"></script>
<script type="text/javascript" src="js/setup.js"></script>
<script type="text/javascript" src="js/main.js"></script>
</head>

 <style type="text/css"> 
body  {
    margin: 0; 
    padding: 0;
    text-align: center;
}
.bodyclass #container { 

    margin: 0 auto;
    text-align: left;
} 
</style>


<img src="a.jpg" height="220px" width="100%" />
<body class="bodyclass ">
<div id="container">

RIGHT NOW UTC: <span id="UTC_za00"></span>
 <?php
date_default_timezone_set("UTC");
$tim= date("H", time()); 

switch ($tim) {
    case 06:
        echo "the sun is RISING in ISTANBUL(above) and SETTING in Landon (below)";
        break;
    case 07:
        echo "the sun is RISING in Tel Aviv(above) and SETTING in Brazil (below)";
        break;
    case 08:
        echo "RISING IN MAURITANIA(above) and SETTING in Bangladesh (below)";
        break;
    case 13:
        echo "Rising in Maine & Boston (above) and SETTING in Denmark (below)";
        break;
    case 14:
        echo " Sun is rising in Minnesota(above) and SETTING in Germany (below).Message to xyz TAKE A SUNSET PHOTO NOW";
        break;
    case 15:
        echo "Sun is rising in Vegas (above) and SETTING in Spain (below)";
        break;
    case 16:
        echo "Sunrise in San Francisco (above) and SETTING in Turkey (below)";
        break;
    case 17:
        echo "Sunrise in Western Canada (above) and SETTING in United states (below)";
        break;
    case 18:
        echo "The sun is RISING in Alaska & Hawaii (above) and SETTING in Switzerland (below), take a SUNSET MATCH NOW!";
        break;
    case 19:
        echo "Sunrise in San RUSSIA (above) and SETTING in Turkey (below)";
        break;
    case 20:
        echo "Sunrise in San Australia (above) and SETTING in India (below)";
        break;
    case 21:
        echo "RISING IN MAURITANIA (above) and SETTING in Egypt (below)";
        break;
    case 22:
        echo "RISING ISTANBUL (above) and SETTING in France (below)";
        break;
    case 23:
        echo "Sunrise in San Tel Aviv (above) and SETTING in Sri Lanka (below)";
        break;
    default :
     echo "RISING IN MAURITANIA(above) and SETTING in Bangladesh (below)";


}
?>

<p>To contribute sunset & sunrise photos to this project and help make a real time match (and make $100), get the <a 

href="https://play.google.com/store/apps/details?id=com.joya.matchthesunset" id="time_is_links">android app</a> or follow us <a 

href="https://twitter.com/2pics1sun" id="time_is_linkss">@2pics1sun</a> on twitter </p>

<script>
time_is_widget.init({
UTC_za00 : {},
New_York_z161 : {
template: "SUN",
sun_format: "srhour:srminute",
coords: "40.71427,-74.00597"
},
Tokyo_z444 : {
coords: "59.33258,18.06490"
}
});
</script>type your content here</div>
</body>

<!-- Slider -->
<div class="bannerbg">
    <div class="container clearfix">

            <div class="flexslider" >
            <ul class="slides">
       <?php $qry="SELECT * from imagepath ORDER BY id DESC LIMIT 1";
             $result=mysql_query($qry);
          while($fetch=mysql_fetch_assoc($result))
          {
        ?>
                <li>
                    <img src="<?php echo $fetch['path']; ?>"  height="360" width="940" alt="" />
                </li>
现在太阳在世界上什么地方升起和落下
太阳现在在世界上的什么地方升起和落下
身体{
保证金:0;
填充:0;
文本对齐:居中;
}
.bodyclass#容器{
保证金:0自动;
文本对齐:左对齐;
} 
现在UTC:
要为这个项目提供日落和日出照片,并帮助进行实时匹配(并赚取100美元),请获取或在twitter上关注我们

时间是widget.init({ UTC_za00:{}, 纽约z161:{ 模板:“太阳”, sun_格式:“srhour:srminute”, 坐标:“40.71427,-74.00597” }, 东京(z444){ 坐标:“59.33258,18.06490” } }); 在此处键入您的内容
  • “height=“360”width=“940”alt=”“/>
我们正在使用他们的脚本向您显示当前UTC时间,因此……“查找当前UTC时间”

任何地点或时区的时间。是!"




您明确地将文本设置为左对齐

您有以下CSS:

.bodyclass #container {
    margin: 0 auto;
    text-align: left;
}
将其更改为:

.bodyclass #container {
    margin: 0 auto;
    text-align: center;
}
您确实使用了
文本对齐:居中设置了
正文
,并且您使用
#容器
上的css覆盖了该设置。但是,我建议在需要时在特定元素上设置
文本对齐


另外,由于您没有在
#容器上设置
宽度
,因此不需要
边距:0 auto;

您明确地将文本设置为左对齐

您有以下CSS:

.bodyclass #container {
    margin: 0 auto;
    text-align: left;
}
将其更改为:

.bodyclass #container {
    margin: 0 auto;
    text-align: center;
}
您确实使用了
文本对齐:居中设置了
正文
,并且您使用
#容器
上的css覆盖了该设置。但是,我建议在需要时在特定元素上设置
文本对齐


另外,由于您没有在
#容器上设置
宽度
,因此不需要
边距:0 auto;

您明确地将文本设置为左对齐

您有以下CSS:

.bodyclass #container {
    margin: 0 auto;
    text-align: left;
}
将其更改为:

.bodyclass #container {
    margin: 0 auto;
    text-align: center;
}
您确实使用了
文本对齐:居中设置了
正文
,并且您使用
#容器
上的css覆盖了该设置。但是,我建议在需要时在特定元素上设置
文本对齐


另外,由于您没有在
#容器上设置
宽度
,因此不需要
边距:0 auto;

您明确地将文本设置为左对齐

您有以下CSS:

.bodyclass #container {
    margin: 0 auto;
    text-align: left;
}
将其更改为:

.bodyclass #container {
    margin: 0 auto;
    text-align: center;
}
您确实使用了
文本对齐:居中设置了
正文
,并且您使用
#容器
上的css覆盖了该设置。但是,我建议在需要时在特定元素上设置
文本对齐


另外,由于您没有在
#container
上设置
宽度
,因此不需要
页边距:0 auto;

使用中心标记…或文本对齐:居中;使用中心标记…或文本对齐:居中;使用中心标记…或文本对齐:居中;将我移到它。这将覆盖您的css文件打败我。或者只是删除它。这是覆盖你的css文件打败我。或者只是删除它。这是覆盖你的css文件打败我。或者只是删除它。这是覆盖你的css文件