Django-related knowledge

Source: Internet
Author: User

Layout:
Header
Body
Footer
$ (#). Hide ()

Add:
Cursor:pointer; For a tag, the mouse becomes smaller hand
A-label underline disappears: Text-decoration:none
Z-index: value, layer distribution
Rounded Corners: border-radius:50%
. Header.menu a:hover{}

Change color in Mouse point
Example:
<! DOCTYPE html>
<meta charset= "UTF-8" >
<title></title>
<style>
. header {
background-color:red;
}
. header. Menu a{
padding:15px;
}
. header. Menu a:hover{//header menu has spaces in the middle, hover changes all a-label background color to Green
Background-color:green; //
}
</style>
<body>
<div class= "Header" >
<div class= "Container" >
<div class= "Menu" >
<a href= "#" > Menu one </a>
<a href= "#" > Menu </a>
<a href= "#" > Menu </a>
</div>
</div>
</div>
</body>

Examples of small bubbles:
<! DOCTYPE html>
<meta charset= "UTF-8" >
<title></title>
<style>
. arrow{
Display:inline-block;
border-top:10px solid;
border-right:10px solid;
border-bottom:10px solid;
border-left:10px solid;

Border-top-color:transparent;
Border-right-color:black;
Border-bottom-color:transparent;
Border-left-color:transparent;
}

</style>
<body>
<div class= "Arrow" > </div>
</body>

Web Request Flow:
Request->socket-> Framework
Html:views Templates
Database: Models
Processing request function: Controllers Viems
Abbreviation: MVC
Django

To create a Django project:
Django-admin Startproject SiteName
Create an App
Python manage.py Startapp AppName
Synchronizing databases
Python manage.py syncdb
Python manage.py makemigrations
Python manage.py Migrate

{%include%} Import HTML
{%block%} inherits HTML, inherits only one
Motherboard: {% block title%}{% Endblock%}
Sub-board: {% extends "base.html"%}//Inheritance
{% block title%} {% Endblock%}
Overall layout with master, single piece when using include
How to refer to the master version:
Create the master directory inside the templates, create the m1.html master inside the master, and then templates
Create the sub-html,son1.html below, then define the function below, then define the URL below urls.py

Django-related knowledge

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.