我正在創建一個ul列表,但我的問題是該列表不工作,因爲它調用了一些其他的CSS。我如何覆蓋邊距:0;填充:0; border:0; css樣式從主體css爲ul li
body, div, span, ul, li, input, a, p, h1, h2, h3, h4, h5, img, table, tr, th, td {
border: 0 none;
box-sizing: border-box;
margin: 0;
outline: 0 none;
padding: 0;
}
<ul id="" class="">
<li><p>Laparoscopic Surgery</p></li>
\t <ul>
\t \t <li>Hernia</li>
\t \t \t <ul>
\t \t \t \t <li>Inguinal</li>
\t \t \t \t <li>Femoral</li>
\t \t \t \t <li>Incisional</li>
\t \t \t \t <li>Hiatal</li>
\t \t \t \t <li>Umbilical</li>
\t \t \t </ul>
\t \t <li>Cholecystectomy (Gallbladder removal)</li>
\t \t <li>Lysis of Adhesion</li>
\t \t <li>Appendectomy</li>
\t \t <li>Ectopic Pregnancy</li>
\t \t <li>Myomectomy (removal of tumor (usually fibroid) in uterus)</li>
\t \t <li>Oopherectomy/Salpingectomy (Ovary/ Fallopian tubes)</li>
\t \t <li>Ovarian Cyst (Resection/cystectomy)</li>
\t \t <li>Splenectomy (spleen)</li>
\t \t <li>Tubal Ligation</li>
\t </ul>
\t
<li>• \t Thyroidectomy (thyroid)</li>
<li>• \t Abdominal Surgery</li>
<li>o \t Open vs. Laparoscopic</li>
<li>? \t Splenectomy</li>
<li>? \t Appendectomy</li>
<li>• \t Septoplasty - Tonsil & Adenoid</li>
<li>• \t Rhinoplasty (nose)</li>
<li>• \t Vein Ligation and stripping (varicose or esophageal)</li>
<li>• \t Insertion of Pacemaker</li>
<li>• \t Cesarean Section</li>
<li>• \t Hysterectomy – abdominal or vaginal</li>
<li>• \t D & C (Dilitation & Curettage, possible miscarriage)</li>
<li>• \t I & D – skin /subcutaneous abscess or cyst (Incision & Drainage)</li>
<li>• \t Cataract Extraction</li>
<li>• \t Retinal Detachment</li>
</ul>
那麼,如何可以覆蓋餘量:0;填充:0; border:0; ,這樣我可以很容易地獲得列表格式。
刪除 padding:0;
解決我的查詢,但我想用它爲我的全局CSS
使用常識,而不是'important'!只需將規則放在body ...規則之後就足夠了。 –
雖然'!important'可以工作,但最好在類定義中更具體一些(如果可能)。在這種情況下,「body ul」就足夠了。儘可能避免「重要」。 – MueR
@Lelio Faieta感謝這爲我工作。你我沒有用過!重要 – Niks