Почему граница ul шире границы таблицы? - PullRequest
0 голосов
/ 17 января 2010

Почему граница ul шире границы таблицы? Почему высота ul не содержит все элементы li?

Большое спасибо за помощь ...

alt text

    ul
    {
        font-family: Verdana;
        font-size: 8pt;
    }

    ul a
    {
        text-decoration: none;
        color: Black;
    }

    ul a:hover
    {
        text-decoration: underline;
    }

    table
    {
        background-color: Transparent;
        border-collapse: collapse;
    }
    table tr td
    {
        vertical-align: top;
        text-align: left;
        font: Verdana, Geneva, sans-serif;
        font-size: 12px;
    }

    #tblYayinAkisi
    {
        border:1px white solid;
        background-color: #222222;
        font-family: Verdana;
        color: #ffffff;
        vertical-align: middle;
        font-size: 10pt;
        width:100%;
    }

    #tblYayinAkisi th
    {
        background-color: Transparent;
        background-image: url(../images/bckSiyahGriTram.png);
        background-repeat: repeat-x;
        height: 20px;
        padding-left: 10px;
    }

    #tblYayinAkisi td
    {
        background-color: #222222;
    }

    #tblYayinAkisi td ul
    {
        border:1px white solid;
        width:100%;
        margin-left: 10px;
    }
    #tblYayinAkisi td ul li
    {
        clear:both;
        padding-top: 7px;
        list-style: none;
    }
    #tblYayinAkisi td ul li b
    {
        margin-right: 10px;
        float: left;
    }

    #tblYayinAkisi td ul li a
    {
        color: #ffffff;
        float: left;
    }

Полный код:

    <html>
    <head>
        <style>
            body
            {
                background-color: Red;
            }
            ul
            {
                font-family: Verdana;
                font-size: 8pt;
            }
            ul a
            {
                text-decoration: none;
                color: Black;
            }
            ul a:hover
            {
                text-decoration: underline;
            }
            table
            {
                background-color: Transparent;
                border-collapse: collapse;
            }
            table tr td
            {
                vertical-align: top;
                text-align: left;
                font: Verdana, Geneva, sans-serif;
                font-size: 12px;
            }
            #tblYayinAkisi
            {
                border: 1px white solid;
                background-color: #222222;
                font-family: Verdana;
                color: #ffffff;
                vertical-align: middle;
                font-size: 10pt;
                width: 100%;
            }
            #tblYayinAkisi th
            {
                background-color: Transparent;
                background-image: url(../images/bckSiyahGriTram.png);
                background-repeat: repeat-x;
                height: 20px;
                padding-left: 10px;
            }
            #tblYayinAkisi td
            {
                background-color: #222222;
            }
            #tblYayinAkisi td ul
            {
                border: 1px white solid;
                width: 100%;
                margin-left: 10px;
            }
            #tblYayinAkisi td ul li
            {
                clear: both;
                padding-top: 7px;
                list-style: none;
            }
            #tblYayinAkisi td ul li b
            {
                margin-right: 10px;
                float: left;
            }
            #tblYayinAkisi td ul li a
            {
                color: #ffffff;
                float: left;
            }
        </style>
    </head>
    <body>
        <table id="tblYayinAkisi">
            <tbody>
                <tr>
                    <th>
                        YABAN'da bugün
                    </th>
                </tr>
                <tr>
                    <td>
                        <ul>
                            <li><b>00:00</b><a target="_blank" href="programlar.aspx?id=24">TROFE ODASI</a></li>
                            <li><b>01:00</b><a target="_blank" href="programlar.aspx?id=17">YERLİ YABAN</a></li>
                            <li><b>01:30</b><a target="_blank" href="programlar.aspx?id=16">HEDEF</a></li>
                            <li><b>02:00</b><a target="_blank" href="programlar.aspx?id=28">İZCİ</a></li>
                            <li><b>02:30</b><a target="_blank" href="programlar.aspx?id=4">KUŞLAR</a></li>
                        </ul>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div style="text-align: center;">
                            <img src="images/canliYayin.png" />
                            <img src="images/tumAkis.png" />
                        </div>
                        <br />
                    </td>
                </tr>
            </tbody>
        </table>
    </body>
    </html>

Ответы [ 2 ]

1 голос
/ 17 января 2010

Проблема с высотой возникает из-за того, что у вас есть содержимое b и плавающее содержимое - это означает, что у элемента li нет реального (то есть не плавающего) содержимого.Снимите плавающий с, и вы должны быть в порядке.

0 голосов
/ 17 января 2010

Просто удалите ширину 100% для элемента ul и добавьте правое поле, например:

 #tblYayinAkisi td ul
 {
     border: 1px white solid;
     margin-left: 10px;
     margin-right: 10px;
 }

Это исправляет отображение в Firefox и должно работать для других браузеров.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...