用户在CSS中创建新评论时,元素保持移动

时间:2019-06-21 08:02:19

标签: html css styling

我正在通过Django在HTML和CSS中创建网站。但是我有一些困难。这是我的代码中错误元素的代码:

Sub btnVar() ' function to show only articles with variable data
    onlyVar (True)
End Sub

Sub btnConst() ' function to show only articles with constant data
    onlyVar (False)
End Sub

Sub onlyVar(check As Boolean)
    calcOff 'disable screen updates etc

'first show all articles 
ActiveSheet.PivotTables("PivotTable1").PivotFields("Artikel").ClearAllFilters

    Dim dict As Dictionary
    Set dict = New Dictionary
    art = 9 'start from column 9
    article = Sheet4.Cells(3, art).Value 'first article name
    lrow = Cells(Rows.Count, art).End(xlUp).Row 'find last row

' set article visibility in dictionary according to desired filter (constant/variable
    Do While article <> "" 'loop over article names until end of table
        If Sheet4.Cells(4, art).Value = Application.Average(Range(Cells(4, art), Cells(lrow, art))) Then
            dict.Add article, Not check 
        Else
            dict.Add article, check
        End If
        art = art + 1
        article = Sheet4.Cells(3, art).Value
    Loop

' set the filters, this causes the table & chart to update every time a filter is set.
' it is fine for table only but with chart it gets super slow.

    With ActiveSheet.PivotTables("PivotTable1").PivotFields("Artikel")
        For Each ptitm In .PivotItems
            ptitm.Visible = dict.Item(ptitm.Name)
        Next
    End With
    calcOn 're-enable screen updates etc
End Sub

Public Sub calcOff()
    Application.Calculation = xlCalculationManual
    Application.DisplayStatusBar = False
    Application.EnableEvents = False
    Application.ScreenUpdating = False
End Sub

Public Sub calcOn()
    Application.Calculation = xlCalculationAutomatic
    Application.DisplayStatusBar = True
    Application.EnableEvents = True
    Application.ScreenUpdating = True
End Sub

在我输入新评论之前,该代码似乎可以正常工作。然后,该元素向下跳并在添加新评论时保持跳动。在尝试detail.html <div class="contact-info" style="float: right!important; position: sticky!important; margin-right: 25px!important; margin-left: 750px!important; width: 30%!important; height: 50px!important; padding-bottom: 195px!important; margin-top: -2200px!important;"> <div class="elements" style=" margin-bottom: 200px!important; padding-bottom: 20px!important;"> <div class="address"> <span class="icon-map-marker"></span> <p> <a style="color:grey!important; border:none!important;" href="{{restraunt.address_link}}">{{restraunt.address}}</a></p> </div> <div class="address" > <span class="icon-mobile-phone"></span> <p style="color: grey!important; border: none!important;"><a style="color:grey!important; border: none!important;" href="tel:{{restraunt.phone}}" style="color: grey!important;">+{{restraunt.phone|phonenumber}}</a> </p> </div> <div class="address"> <span class="icon-link"></span> <p><a style="color:grey!important; border: none!important;" href="{{restraunt.website}}">{{restraunt.website}}</a></p> </div> <div class="address"> <span style="" class="icon-time"></span> <p>Mon - Sun, {{restraunt.opening_hour}} - {{restraunt.closing_hour}} <br> </div> </div> </div> postion: relativepostition: absolute时,我不知道如何解决此问题,但是似乎都失败了。我将放一些屏幕截图以更好地解释它。

在进行新评论之前:

enter image description here

经过新的审核:

enter image description here

很长一段时间以来,我一直无法解决这个问题。我真的很感谢您的帮助。谢谢

0 个答案:

没有答案