From 15d6788223190e5327e7b07c6906462c1dcf1513 Mon Sep 17 00:00:00 2001 From: MjSeven <33125422+MjSeven@users.noreply.github.com> Date: Fri, 16 Nov 2018 22:06:18 +0800 Subject: [PATCH 1/8] Update 20180131 For your first HTML code lets help Batman write a love letter.md --- ...de lets help Batman write a love letter.md | 270 +++++++++++++++++- 1 file changed, 269 insertions(+), 1 deletion(-) diff --git a/sources/tech/20180131 For your first HTML code lets help Batman write a love letter.md b/sources/tech/20180131 For your first HTML code lets help Batman write a love letter.md index 78cb024bb4..56cccf15e1 100644 --- a/sources/tech/20180131 For your first HTML code lets help Batman write a love letter.md +++ b/sources/tech/20180131 For your first HTML code lets help Batman write a love letter.md @@ -556,4 +556,272 @@ We want to apply our styles to the specific div and img that we are using right
+ + After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. +
+``` + ``` ++ You complete my darkness with your light. I love: +
++ I have learned a lot from you. You have occupied a special place in my heart over the time. +
++ It feels like my chest does have a heart. You make my heart beat. Your smile brings smile on my face, your pain brings pain to my heart. +
++ I don't show my emotions, but I think this man behind the mask is falling for you. +
+I love you Superman.
+
+ Your not-so-secret-lover,
+ Batman
+
+ + After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. +
++ You complete my darkness with your light. I love: +
++ I have learned a lot from you. You have occupied a special place in my heart over the time. +
++ It feels like my chest does have a heart. You make my heart beat. Your smile brings smile on my face, your pain brings pain to my heart. +
++ I don't show my emotions, but I think this man behind the mask is falling for you. +
+I love you Superman.
+
+ Your not-so-secret-lover,
+ Batman
+
+ + After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. +
++ You complete my darkness with your light. I love: +
++ I have learned a lot from you. You have occupied a special place in my heart over the time. +
++ It feels like my chest does have a heart. You make my heart beat. Your smile brings smile on my face, your pain brings pain to my heart. +
++ I don't show my emotions, but I think this man behind the mask is falling for you. +
+I love you Superman.
+
+ Your not-so-secret-lover,
+ Batman
+
+ + After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. +
++ You complete my darkness with your light. I love: +
++ I have learned a lot from you. You have occupied a special place in my heart over the time. +
++ It feels like my chest does have a heart. You make my heart beat. Your smile brings smile on my face, your pain brings pain to my heart. +
++ I don't show my emotions, but I think this man behind the mask is falling for you. +
+I love you Superman.
+
+ Your not-so-secret-lover,
+ Batman
+
: for paragraphs
+ *
: for line breaks
+ *
` and `
`, then the browser will know that the text inside the `` and `
` is a paragraph. Let’s do this: - -``` -After all the battles we fought together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you.
-``` - -By writing the paragraph inside `` and `
` you created an HTML element. A web page is collection of HTML elements. - -Let’s get some of the terminologies out of the way first: `` is the opening tag, `
` is the closing tag, and “p” is the tag name. The text inside the opening and closing tag of an element is that element’s content. - -### The “style” attribute - -You will see that the text covers the entire width of the screen. - -We don’t want that. No one want’s to read such long lines. Let’s give a width of, say, 550px to our paragraph. - -We can do that by using the element’s “style” attribute. You can define an element’s style (for example, width in our case), inside its style attribute. The following line will create an empty style attribute on a “p” element: - -``` -...
-``` - -You see that empty `""`? That’s where we will define the looks of the element. Right now we want to set the width to 550px. Let’s do that: - -``` -- After all the battles we fought together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -
-``` - -We set the “width” property to 550px separated by a colon “:” and ended by a semicolon “;”. - -Also, notice how we put the `` and `
` in separate lines and the text content indented with one tab. Styling your code like this makes it more readable. - -### Lists in HTML - -Next, Batman wants to list some of the virtues of the person that he admires, like this: - -“ You complete my darkness with your light. I love: -- the way you see good in the worst things -- the way you handle emotionally difficult situations -- the way you look at Justice -I have learned a lot from you. You have occupied a special place in my heart over time.” - -This looks simple. - -Let’s go ahead and copy the required text below the `:` - -``` -- After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -
-- You complete my darkness with your light. I love: - - the way you see good in the worse - - the way you handle emotionally difficult situations - - the way you look at Justice - I have learned a lot from you. You have occupied a special place in my heart over the time. -
-``` - -Save and refresh your browser. - - - - -Woah! What happened here, where is our list? - -If you look closely, you will observe that line breaks are not displayed. We wrote the list items in new lines in our code, but those are displayed in a single line in the browser. - -If you want to insert a line break in HTML (newline) you have to mention it using `- After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -
-
- You complete my darkness with your light. I love:
- - the way you see good in the worse
- - the way you handle emotionally difficult situations
- - the way you look at Justice
- I have learned a lot from you. You have occupied a special place in my heart over the time.
-
- After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -
-``` - -``` -- You complete my darkness with your light. I love: -
- After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -
-``` - -``` -- You complete my darkness with your light. I love: -
-``` - -``` -- I have learned a lot from you. You have occupied a special place in my heart over the time. -
-``` - -Save and reload. - -Notice that this time we defined the width of the “ul” element also. That’s because we have now moved our “ul” element out of the “p” element. - -Defining the width of all the elements of our letter can become cumbersome. We have a specific element for this purpose: the “div” element. A “div” element is a generic container which is used to group content so it can be easily styled. - -Let’s wrap our entire letter with a div element and give width:550px to that div element: - -``` -- After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -
-- You complete my darkness with your light. I love: -
-- I have learned a lot from you. You have occupied a special place in my heart over the time. -
-- After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -
-``` - -``` -- You complete my darkness with your light. I love: -
-- I have learned a lot from you. You have occupied a special place in my heart over the time. -
-
- - After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -
-``` - -``` -- You complete my darkness with your light. I love: -
-- I have learned a lot from you. You have occupied a special place in my heart over the time. -
-
- - After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -
-``` - -``` -- You complete my darkness with your light. I love: -
-- I have learned a lot from you. You have occupied a special place in my heart over the time. -
-
- - After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -
-``` - -``` -- You complete my darkness with your light. I love: -
-- I have learned a lot from you. You have occupied a special place in my heart over the time. -
-- It feels like my chest does have a heart. You make my heart beat. Your smile brings smile on my face, your pain brings pain to my heart. -
-- I don't show my emotions, but I think this man behind the mask is falling for you. -
-I love you Superman.
-
- Your not-so-secret-lover,
- Batman
-
- - After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -
-``` - -``` -- You complete my darkness with your light. I love: -
-- I have learned a lot from you. You have occupied a special place in my heart over the time. -
-- It feels like my chest does have a heart. You make my heart beat. Your smile brings smile on my face, your pain brings pain to my heart. -
-- I don't show my emotions, but I think this man behind the mask is falling for you. -
-I love you Superman.
-
- Your not-so-secret-lover,
- Batman
-
- - After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -
-``` - -``` -- You complete my darkness with your light. I love: -
-- I have learned a lot from you. You have occupied a special place in my heart over the time. -
-- It feels like my chest does have a heart. You make my heart beat. Your smile brings smile on my face, your pain brings pain to my heart. -
-- I don't show my emotions, but I think this man behind the mask is falling for you. -
-I love you Superman.
-
- Your not-so-secret-lover,
- Batman
-
- - After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -
-``` - ``` -- You complete my darkness with your light. I love: -
-- I have learned a lot from you. You have occupied a special place in my heart over the time. -
-- It feels like my chest does have a heart. You make my heart beat. Your smile brings smile on my face, your pain brings pain to my heart. -
-- I don't show my emotions, but I think this man behind the mask is falling for you. -
-I love you Superman.
-
- Your not-so-secret-lover,
- Batman
-
- - After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -
-- You complete my darkness with your light. I love: -
-- I have learned a lot from you. You have occupied a special place in my heart over the time. -
-- It feels like my chest does have a heart. You make my heart beat. Your smile brings smile on my face, your pain brings pain to my heart. -
-- I don't show my emotions, but I think this man behind the mask is falling for you. -
-I love you Superman.
-
- Your not-so-secret-lover,
- Batman
-
- - After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -
-- You complete my darkness with your light. I love: -
-- I have learned a lot from you. You have occupied a special place in my heart over the time. -
-- It feels like my chest does have a heart. You make my heart beat. Your smile brings smile on my face, your pain brings pain to my heart. -
-- I don't show my emotions, but I think this man behind the mask is falling for you. -
-I love you Superman.
-
- Your not-so-secret-lover,
- Batman
-
- - After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. -
-- You complete my darkness with your light. I love: -
-- I have learned a lot from you. You have occupied a special place in my heart over the time. -
-- It feels like my chest does have a heart. You make my heart beat. Your smile brings smile on my face, your pain brings pain to my heart. -
-- I don't show my emotions, but I think this man behind the mask is falling for you. -
-I love you Superman.
-
- Your not-so-secret-lover,
- Batman
-
: for paragraphs
- *
: for line breaks
- *
+ + After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. +
+``` + +``` ++ You complete my darkness with your light. I love: +
++ I have learned a lot from you. You have occupied a special place in my heart over the time. +
++ It feels like my chest does have a heart. You make my heart beat. Your smile brings smile on my face, your pain brings pain to my heart. +
++ I don't show my emotions, but I think this man behind the mask is falling for you. +
+I love you Superman.
+
+ Your not-so-secret-lover,
+ Batman
+
+ + After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. +
+``` + +``` ++ You complete my darkness with your light. I love: +
++ I have learned a lot from you. You have occupied a special place in my heart over the time. +
++ It feels like my chest does have a heart. You make my heart beat. Your smile brings smile on my face, your pain brings pain to my heart. +
++ I don't show my emotions, but I think this man behind the mask is falling for you. +
+I love you Superman.
+
+ Your not-so-secret-lover,
+ Batman
+
+ + After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. +
++ You complete my darkness with your light. I love: +
++ I have learned a lot from you. You have occupied a special place in my heart over the time. +
++ It feels like my chest does have a heart. You make my heart beat. Your smile brings smile on my face, your pain brings pain to my heart. +
++ I don't show my emotions, but I think this man behind the mask is falling for you. +
+I love you Superman.
+
+ Your not-so-secret-lover,
+ Batman
+
+ + After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. +
++ You complete my darkness with your light. I love: +
++ I have learned a lot from you. You have occupied a special place in my heart over the time. +
++ It feels like my chest does have a heart. You make my heart beat. Your smile brings smile on my face, your pain brings pain to my heart. +
++ I don't show my emotions, but I think this man behind the mask is falling for you. +
+I love you Superman.
+
+ Your not-so-secret-lover,
+ Batman
+
+ + After all the battles we faught together, after all the difficult times we saw together, after all the good and bad moments we've been through, I think it's time I let you know how I feel about you. +
++ You complete my darkness with your light. I love: +
++ I have learned a lot from you. You have occupied a special place in my heart over the time. +
++ It feels like my chest does have a heart. You make my heart beat. Your smile brings smile on my face, your pain brings pain to my heart. +
++ I don't show my emotions, but I think this man behind the mask is falling for you. +
+I love you Superman.
+
+ Your not-so-secret-lover,
+ Batman
+
\
) + + * 如何使用 style 属性在元素内编写样式(这称为内联样式,尽可能避免这种情况) + + * 如何在 中编写元素的样式(这称为嵌入式样式) + + * 在 HTML 中如何使用 在单独的文件中编写样式并链接它(这称为链接样式表) + + * 什么是标签名称,属性,开始标签和结束标签 + + * 如何使用 id 属性为一个元素赋予 id + + * CSS 中的标签选择器和 id 选择器 + +我们学习了以下 HTML 标签: + + * \:用于段落
+
+ * \
:用于换行
+
+ * \