【问题标题】:Margin from edge边距
【发布时间】:2015-11-14 09:57:44
【问题描述】:

margin的小问题,代码如下:

        echo '<p class="news_post">';
        $stripped = strip_tags($post,'<img>');
        $break = str_replace('>','><br>',$stripped);

        echo $results['post'];

        echo '</span></span>';
        $fetchtags = $results['tags'];
        $string = array ( '/\b(.*?)\b/i' );
        $replace = array ( '<a href="?inav=tag&amp;tag=$1">$1</a>' );
        $tags = preg_replace($string, $replace, $fetchtags);
        echo '<p>Tags: '.$tags.'</p>';

想尝试边缘 10px 的边距帖子吗?还有标签

style.css 看起来像这样:

p.news_container {
    font-size:10px;
    font-family:verdana;
    color:white;
    margin-left: 10px;
    }

p.news_post {
    font-size: 13px;
    font-family:verdana;
    color: #8A8A8A;
    margin-left: 10px;
    }   

我的代码无法正常工作,尝试了所有方法。我想我在某个地方搞砸了。

【问题讨论】:

  • 请发布您的html代码?
  • 你添加了什么,你的html?在哪里?

标签: php css margin


【解决方案1】:

您还没有发布您的 html,我的猜测是 margin-left: 10px; 不适合您,因此请尝试将其更改为:

position: relative;
left: 10px;

我很确定应该可以。

【讨论】:

    猜你喜欢
    • 2011-08-10
    • 1970-01-01
    • 2011-06-05
    • 2012-06-09
    • 1970-01-01
    • 2012-12-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多