【问题标题】:css and php doesnt work [closed]css和php不起作用[关闭]
【发布时间】:2012-10-01 21:21:05
【问题描述】:

由于某种原因它不起作用。 css 存储在 style.css 中,但复选框行内的样式也不起作用。

我的网站是:http://tinyurl.com/8g8ev2m

谢谢...

p.s 我使用 wordpress 和“帖子的 PHP 代码”插件,虽然我不确定它的问题

.Checkboxstyle {
    background-repeat: no-repeat;
    border: 2px solid #DDD;
    height: 150px!important;
    font-size: 150%;
    -webkit-border-radius: 20px;
    -khtml-border-radius: 20px;
    -moz-border-radius: 20px;
    border-radius: 20px; 
    background-image: url(http://doarna.com/wp-content/uploads/2012/09/XCellcom.gif);}
}


<?php

global $wpdb;
$query = "SELECT * FROM wp_organization where type='תקשורת'";
$results = $wpdb->get_results( $query );

    foreach ($results as $result) {
        $MEATZBEN = $result->NAME;
        $MEATZBENID = $result->ID;
        echo "<input type='checkbox' name='$MEATZBENID'  class='Checkboxstyle' 
               style='font-size: 100px;' value='$MEATZBEN'>. $MEATZBEN<br />";

    }

?>

【问题讨论】:

    标签: php css wordpress styles


    【解决方案1】:

    假设您的所有标记实际上都是正确的,这里的问题是您将颜色应用于复选框 - 一个不显示文本的元素。您需要将颜色类应用于复选框旁边的任何文本。

    <style>
    .Checkboxstyle { color: red;}
    </style>
    <input type="checkbox" name="check1" value="1"> <label class="Checkboxstyle">This is my checkbox</label>
    

    【讨论】:

    • 当我尝试 color:red 时它确实有效,但是当我尝试其他属性作为 height: 150px 时它没有,有什么建议吗?谢谢
    • label 不是块级元素。您需要添加 display:block 来修改定位和尺寸
    • 我添加了我的所有属性。谢谢
    猜你喜欢
    • 2014-01-24
    • 1970-01-01
    • 1970-01-01
    • 2018-02-27
    • 2013-05-26
    • 2014-11-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多