CSS and page common problem solutions

①After the css is changed, the page display style remains unchanged

Solution: Generally, it is a cache problem. At this time, the cache file is read instead of the original file. Right-click the refresh button and click Clear Cache or go to the browser settings to clear the cache. After clearing, refresh the page.

②There is more space on the page, containing <

 

<html>
  <body>
      <<div>
            <title>Product List</title>
       </div>
  </body>
</html>

 Solution: Look carefully in the html, add an extra < (see the page for details), and delete it after finding it

 

③Invalidation of attributes in CSS selectors

Solution: semicolon case in css properties 

When writing CSS properties, each CSS property and the corresponding value need to be separated by a semicolon (;) at the end. Capitalizing or omitting the semicolon will cause the properties in the selector to be invalid, so each CSS selector curly braces The CSS property must end with a lowercase semicolon 

 

④Unable to view the webpage

Solution: View server error prompts, configuration data

For example: server display(url(r'^$', views.render_homepage),

AttributeError: 'module' object has no attribute 'render_homepage'

Performing system checks...)

#AttributeError: 'module' object has no attribute 'render_homepage'

Reason: View views were not passed to the template

def render_homepage(request):
    return render(request, 'cart/home.html',{})

Notes: ( The view is where the application logic is stored. It gets the data from the previously created model and passes it to the template) 

 

⑤ Relative position and absolute position relative absolute

Note: Relative positioning has no effect on other elements.

And when relative positioning, if top bottom is set at the same time, only top is valid, bottom is invalid

left right Only left is valid, right is invalid

 

⑥404 error

The web page for the request issued by the user does not exist, and the server is not operating

Solution: The URL of the original webpage is invalid, and the webpage file may be renamed or changed, resulting in the inaccessibility of the URL address. So a 404 is returned, telling the browser that the requested webpage does not exist.

Restore the missing web files to the correct location, set the url, views, and restart the server.

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326942592&siteId=291194637