Posts

Showing posts from 2015

深入淺出JAVA-基本概念(P1~P9)

JAVA-基本概念(P1~P9) JAVA的流程 原始碼->編譯器(compiler)->輸出->模擬器(virtual machine) source(.java) ->Compiler(執行javac編譯source,若沒錯產生class) ->output(code)這時由bytecode組成 ->啟動JVM(java Virtual machine)跑.class檔案 什麼是原始檔? .java帶有class的定義,class是程式的一個組件 小程式或許只有一個類別,類別的內容必須包刮在括號內 public class Human{ } 什麼是class? class帶有一個或多個method walk帶有如何走的指令,method必須宣告在class內 public class Human{ void walk() } 什麼是method? method 是應該執行的指令,程式碼由statement組成 method可以算是一個函式或者程序 public class Human{ void walk(){ statement1; statement2; } } 一個最基本的JAVA class程式 public class Helloworld { public static void main (String[] args) { System. out .print( "It's rule!" ); } } Public 公開給其他類別存取 class 這是個類別 Helloworld 類別的名稱 static 靜態 void 不回傳值 main( ) 程式的進入點 String[] args 傳string的陣列,給此method當參數,命名為args System.out.print 標準輸出 (“It’s rule!”) 要列出的字串名稱 ; 分號作為結尾 在JAVA內所有東西都屬於 某個class 建立原始檔(.java

Make a Website: CSS Styling-Congratulations! 10/10

Image
Congratulations! Congratulations! Using CSS, you transformed the appearance of your web page. Currently the elements sit one on top of the other. It’s possible with CSS to change where elements sit on the page and create good looking page layouts. Let’s see how to do this next. Instructions Click  Save & Submit Code  to continue. Make a Website: CSS Styling-Congratulations! 10/10 <!DOCTYPE html> < html > < head > < link href = "http://s3.amazonaws.com/codecademy-content/courses/ltp/css/shift.css" rel = "stylesheet" > < link href = "main.css" rel = "stylesheet" > </ head > < body > < div class = "nav" > < div class = "container" > < ul > < li > < a href = "#" > Airbnb logo </ a > </ li > < li > < a href = "#"

Make a Website: CSS Styling-Learn More: Link 9/10

Image
Learn More: Link Nicely done! As a last step, let’s change the color of the  a  elements as well. Instructions Make a new CSS rule that selects the  a element inside  < div   class = "learn-more" > .. </ div > Set the  color  to  #00b0ff ? Hint Get live, fast support from Codecademy Advisors when you get stuck. Learn more. To select the  h3  element inside  < div class = "learn-more" > .. </ div > , we used this selector: .learn-more h3 { ... } Make a Website: CSS Styling-Learn More: Link 9/10 .nav a { color : #5a5a5a ; font-size : 11 px ; font-weight : bold ; padding-top : 14 px ; padding-bottom : 14 px ; padding-left : 10 px ; padding-right : 10 px ; text-transform : uppercase ; } .jumbotron { height : 500 px ; background-image : url( 'https://goo.gl/04j7Nn' ) ; } .jumbotron h1 { color : #fff ; font-family : 'Shift' , sans-serif ; font-size : 48 px ; font-w

Make a Website: CSS Styling-Learn More: Heading 8/10

Image
Learn More: Heading Nice! Next, let’s make the  h3  text stand out more by changing the font. In  index.html , inside  < div   class = "learn-more" > .. </ div >  are the  h3  elements we want to style. Therefore, we can select this element in CSS like this: .learn-more h3 { ... } Instructions Make a new CSS rule that selects the  h3 element inside  < div   class = "learn-more" > .. </ div > Set  font-family  to  'Shift', sans-serif Set the  font - size  to  18px Set the  font-weight  to  bold Make a Website: CSS Styling-Learn More: Heading 8/10 .nav a { color : #5a5a5a ; font-size : 11 px ; font-weight : bold ; padding-top : 14 px ; padding-bottom : 14 px ; padding-left : 10 px ; padding-right : 10 px ; text-transform : uppercase ; } .jumbotron { height : 500 px ; background-image : url( 'https://goo.gl/04j7Nn' ) ; } .jumbotron h1 { color : #fff ; font-family : 

Make a Website: CSS Styling-Learn More 7/10

Image
Learn More Looking good! Let's finish up by styling the three pieces of supporting content. In index.html , the  < div   class = "learn-more" > .. </ div >  groups elements that are part of this section. Instructions In  main.css Make a new CSS rule that uses the class selector  .learn-more Set the  background-color  to  #f7f7f7 Make a Website: CSS Styling-Learn More 7/10 .nav a { color : #5a5a5a ; font-size : 11 px ; font-weight : bold ; padding-top : 14 px ; padding-bottom : 14 px ; padding-left : 10 px ; padding-right : 10 px ; text-transform : uppercase ; } .jumbotron { height : 500 px ; background-image : url( 'https://goo.gl/04j7Nn' ) ; } .jumbotron h1 { color : #fff ; font-family : 'Shift' , sans-serif ; font-size : 48 px ; font-weight : bold ; } .jumbotron p { color : #fff ; font-size : 20 px ; } .learn more { background-color : #f7f7f7 ; } <!DOCTYPE html> < ht

Make a Website: CSS Styling-Jumbotron: Fonts 6/10

Image
Jumbotron: Fonts Great! The text inside the large feature section stands out. Let's make the  h1  text stand out more by changing its font. Custom fonts can be loaded from CSS, like this: <!DOCTYPE html> < html > < head > < link href = "font.css" rel = "stylesheet" > < link href = "main.css" rel = "stylesheet" > </ head > ... </ html > Inside the  head  element are two  link elements. The order of these  link  elements matters. The browser first sees the  link  for the custom font  font.css , and makes the font available to use in the page. Next the browser sees the  link  for  main.css . Since the browser now knows about the custom font, we can use it from  main.css  to style elements. Instructions In  index.html  inside the  head  element add this  link  element:  < link href = "http://s3.amazonaws.com/codecademy-content/courses/ltp/css/s