Guest User

Untitled

a guest
Jun 23rd, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. ## environment.rb
  2. # for the css part of the layout to work, you have to let sinatra know that /css/main.css is equal to the main.sass file
  3. get '/css/main.css' do
  4. headers 'Content-Type' => 'text/css; charset=utf-8'
  5. sass :main
  6. end
  7.  
  8. ## layout.haml
  9. !!! Strict
  10. %html
  11. %head
  12. %link{:rel => 'stylesheet', :href => '/css/main.css', :type => 'text/css'}
  13. %title= SiteConfig.title
  14. %body
  15. = yield
  16. ## index.haml
  17. #container
  18. #left
  19. %p Text on the left!
  20. #right
  21. %p Text on the right!
  22. .clear
  23.  
  24. ## main.css
  25. .clear
  26. :clear both
  27.  
  28. #container
  29. :width: 500px
  30. #left
  31. :background blue
  32. :width 225px
  33. :margin-right: 25px
  34. :float left
  35. #right
  36. :background right
  37. :width 225px
  38. :margin-left 25px
  39. :float left
Add Comment
Please, Sign In to add comment