Why does adding float:left to my css make my link unclickable?

前端 未结 4 2250
清歌不尽
清歌不尽 2021-02-12 01:31

I have a view with a section defined thus:

<%=ViewData.Model.Body %>

4条回答
  •  南方客
    南方客 (楼主)
    2021-02-12 02:05

    Your code will be invalid as you are using IDs when this should be a job for classes. This will do what you want:

    #AskingUser {
        border: none;
        float: right;
        width:auto;
        padding: 2px;
        position: relative;
        text-align: right;
    }
    

    and add

    #QuestionBody {
        border-bottom: 1px dotted black;
        overflow: hidden;
    }
    

    I've left it as IDs but you should adjust all your CSS and HTML so that they are classes instead

    .askingUser {} and

    if that makes sense.

提交回复
热议问题