1

Consider the following html code. The parent paragraph style should be inherited to and to the last text. However, the paragraph style is not inherited to last text. The tag is causing some issue. Without tag, the last text would be styled as defined in the paragraph class.

<body>
<p class="paragraph_class1">
    <span>Start paragraph.</span>
    <ul class="list_class3">
        <li class="paragraph_class1 list_detail_class4">
            <span class="text_class5">List item</span>
        </li>
    </ul>
    <span>End paragraph.</span>
</p></body>

    .paragraph_class1
{
color: #ff0000;
border-top-color: #0000ff;
border-left-color: #0000ff;
border-right-color: #0000ff;
border-bottom-color: #0000ff;
border-top-style: solid;
border-left-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-top-width: 2px;
border-left-width: 2px;
border-right-width: 2px;
border-bottom-width: 2px;
background-color: #000000;
}

1 Answer 1

0

Why don't you just add the class to the span tag like so:

<span class="paragraph_class1">End paragraph.</span>

And remember to enclose your css in style-tags

Usually you shouldn't nest ul-tags in p-tags

1
  • I tried adding the class from paragraph tag to span tag. It ended up having multiple border to the text "End paragraph". Not having ul-tag within p-tag might be not possible at the current time as the html and css is being being written dynamically (through java code based of design). Is there any other alternative to fix this to inherit the properties from p tag? Feb 4, 2013 at 9:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.