SlideShare a Scribd company logo
1 of 165
CSS Shop 
Learn yourself some CSS, the fast way.
WhoamI? 
Rúben Gonçalves 
A CSS lover@ OutSystems 
ruben.goncalves@outsystems.com 
rubengoncalves 
Kudosto Marco Costa andMiguel Ventura for makingthispossible.
"Any technology sufficiently advanced is indistinguishable from magic." 
-Arthur C. Clark 
No Magic.
Advanced CSS Solutions
Agenda 
•CSS b-a-ba 
•Bug? Inspect it! 
•Bring to OSDE 
•Box Model 
•Box placement 
•Vertical Alignment 
•Browser compatibility 
•CSS BestPratices 
•Grids & Media queries 
*OSDE –OutSystems Development Environment
Agenda 
•CSS b-a-ba 
•Bug? Inspect it! 
•Bring to OSDE 
•Box Model 
•Box placement 
•Vertical Alignment 
•Browser compatibility 
•CSS BestPratices 
•Grids & Media queries
The Web “three leg stool” 
JavaScript 
HTML 
Colors, 
backgrounds, 
formatting, 
positioning, … 
Additional 
ways for the 
user to interact 
with the application 
Content, 
Data, Containers 
and Tables 
Structure 
Presentation 
Behaviour 
CSS
CSS stands for? 
CSS = CascadingStyleSheets 
WHY ? 
Browser 
Author 
User 
!important 
It’s all about: 
What ruleto apply 
to a certain element 
ais blue 
a is red 
ais gray 
ais purple
But why CSS? 
•A clear separation of presentation and content 
•A set of rules telling the browser how to display elements 
•Allows the sharing of style sheets across documents 
•Makes it easy to "skin" a web site (theme)
Syntax 101 
<selector> { 
<property>: <value>; 
<property>: <value>; 
... 
}
Syntax 101 -Selectors 
•by tag, like div 
•by class, like .MainContent 
•by id, like #wt13_wtMainContent 
•by pseudo-class, like :hover 
•by attribute, like [disabled]or [type=checkbox] 
<divid="wt13_wtMainContent"class="MainContent"> 
<inputtype="checkbox"disabled/>
Syntax 101 -Selectors 
•by tag, like div 
•by class, like .MainContent 
•by id, like #wt13_wtMainContent 
•by pseudo-class, like :hover 
•by attribute, like [disabled]or [type=checkbox] 
<divid="wt13_wtMainContent"class="MainContent"> 
<inputtype="checkbox"disabled/>
Syntax 101 -Selectors 
•by tag, like div 
•by class, like .MainContent 
•by id, like #wt13_wtMainContent 
•by pseudo-class, like :hover 
•by attribute, like [disabled]or [type=checkbox] 
<divid="wt13_wtMainContent"class="MainContent"> 
<inputtype="checkbox"disabled/>
Syntax 101 -Selectors 
•by tag, like div 
•by class, like .MainContent 
•by id, like #wt13_wtMainContent 
•by pseudo-class, like :hover 
•by attribute, like [disabled]or [type=checkbox] 
<divid="wt13_wtMainContent"class="MainContent"> 
<inputtype="checkbox"disabled/>
Syntax 101 -Selectors 
•by tag, like div 
•by class, like .MainContent 
•by id, like #wt13_wtMainContent 
•by pseudo-class, like :hover 
•by attribute, like [disabled]or [type=checkbox] 
<divid="wt13_wtMainContent"class="MainContent"> 
<inputtype="checkbox"disabled/>
Syntax 101 –Selectors 
•by pseudo-class: 
o.MainContent >:first-child 
o.MainContent >:last-child 
<divid="wt13_wtMainContent"class="MainContent"> 
<inputtype="checkbox"disabled/> 
<inputtype="text"/> 
<div> 
<inputtype="text"/> 
</div> 
</div>
Syntax 101 –Selectors 
•by pseudo-class: 
o.MainContent >:first-child 
o.MainContent >:last-child 
<divid="wt13_wtMainContent"class="MainContent"> 
<inputtype="checkbox"disabled/> 
<inputtype="text"/> 
<div> 
<inputtype="text"/> 
</div> 
</div>
Syntax 101 –Selectors 
•by pseudo-class: 
o.MainContent >:first-child 
o.MainContent >:last-child 
•by parent: 
o.MainContent> input[Type=“text”] 
o.MainContentinput 
o.MainContentinput + input 
<divid="wt13_wtMainContent"class="MainContent"> 
<inputtype="checkbox"disabled/> 
<inputtype="text"/> 
<div> 
<inputtype="text"/> 
</div> 
</div>
Syntax 101 –Selectors 
•by pseudo-class: 
o.MainContent >:first-child 
o.MainContent >:last-child 
•by parent: 
o.MainContent> input[Type=“text”] 
o.MainContentinput 
o.MainContentinput + input 
<divid="wt13_wtMainContent"class="MainContent"> 
<inputtype="checkbox"disabled/> 
<inputtype="text"/> 
<div> 
<inputtype="text"/> 
</div> 
</div>
Syntax 101 –Selectors 
•by pseudo-class: 
o.MainContent >:first-child 
o.MainContent >:last-child 
•by parent: 
o.MainContent> input[Type=“text”] 
o.MainContentinput 
o.MainContentinput + input 
<divid="wt13_wtMainContent"class="MainContent"> 
<inputtype="checkbox"disabled/> 
<inputtype="text"/> 
<div> 
<inputtype="text"/> 
</div> 
</div>
Syntax 101 –Selectors
Syntax 101 -Selector COMBOs 
•Apply same style to many selectors 
oselector 1,selector 2
Syntax 101 -Selector COMBOs 
•Apply same style to many selectors 
oselector 1,selector 2 
•Elements one inside another 
o.head .title{ font-size: xx-large; }
Syntax 101 -Selector COMBOs 
•Apply same style to many selectors 
oselector 1,selector 2 
•Elements one inside another 
o.head .title{ font-size: xx-large; } 
•By tag, class, with two attributes 
oinput.big[type=checkbox][disabled]{ cursor: not-allowed; }
Syntax 101 -Selector COMBOs 
#container div.deployButton a:hover, 
#container div.deployButton input[disabled]:active{ 
background-color: red; 
} 
Let’sseetheeffect
Syntax 101 –Rule Priority 
•Most specific wins 
1.style=“value” 
2.#someid 
3..classor [attributes] 
4.tags 
5.*
Specs say: 
Use #IDsto apply style to single element 
Use .classto apply style to a class of elements 
But in OutSystems 
IDs are generated dynamically --you can't predict them… 
So use classes everywhere instead. 
PROBLEM SOLVED! 
OutSystems Checkpoint
Syntax 101 –Rule Priority 
•Definitionordermatters
Syntax101 –RulePriority 
Example
CSS Import Order
Syntax 101 –Rule Priority 
Example 
<divclass="outer"id="outerdiv"> 
<divclass="inner"id="innerdiv1"> 
hello 
</div> 
</div> 
Let’sseetheeffect
Syntax 101 -Properties 
•Text properties 
ofont (size, weight, style), color, transform, spacing, line, align, direction 
•Background 
ocolors, images, patterns 
•Box 
owidth, height, margin, border, shadow 
•Layout 
opositioning, visibility, overflow, white-space, floating
Syntax 101 -Properties 
Thinking of doing X? 
There's probably a CSS property for that. 
Good references: 
•W3C CSS spec 
•MDN
Exercise 0 
•Get your gear http://goo.gl/ql8CHD 
•Login to your personal environment 
•Publish the eSpace CSSShop 
•Except requested, all css should be done in the respective Page.
Exercise 1 
•Follow the instruction on page Exercise1
Exercise 2 
•Follow the instruction on page Exercise2
Agenda 
•CSS b-a-ba 
•Bug? Inspect it! 
•Bring to OSDE 
•Box Model 
•Box placement 
•Vertical Alignment 
•Browser compatibility 
•CSS BestPratices 
•Grids & Media queries
http://worrydream.com/#!/LadderOfAbstraction 
Instant Feedback= Faster Improvement & Better Ideas
You need instant feedback... Uhh... Where was I?
Inspector Demo!
Inspector Demo!
Case Study
CSS3 
Eye candy effects
CSS3 
Eye candy effects 
And lots of really useful stuff 
Transforms, transitions, animations, gradients, multiple columns, multiple backgrounds, counters, flexboxes, speech, fonts, ...
CSS3 
Cool 
Experimental 
Use with caution
Agenda 
•CSS b-a-ba 
•Bug? Inspect it! 
•Bring to OSDE 
•Box Model 
•Box placement 
•Vertical Alignment 
•Browser compatibility 
•CSS BestPratices 
•Grids & Media queries
Some markup you find as example in the internet is hard to reproduce in SS, such as lists or HTML5 elements: 
<section> 
<header> 
<nav> 
<ul> <li>...</li> 
<li>...</li> 
</ul> 
</nav> 
</header> 
</section> 
But do you need it? 
OutSystems Checkpoint
Converting from a template: classify everything! 
<sectionid="sec01"class="first"> 
markup 
styles 
section{font-weight: bold; } 
#sec01{font-style: italic; }
Converting from a template: classify everything! 
<sectionid="sec01"class="first"> 
markup 
styles 
.tag-section{font-weight: bold; } 
.id-sec01 {font-style: italic; }
Converting from a template: classify everything! 
markup 
styles 
.tag-section{font-weight: bold; } 
.id-sec01 {font-style: italic; } 
<div 
class="first tag-section id-sec01">
How about the widget tree?
Exercise 3 
•Our customer’s webdesigner handed us a bunch of HTML and CSS files 
•You should convert everything to the OutSystems platform visual design tool! 
•Use TemplateToSSminimalism-template 
•Convert the whole header portion, including the DaVinci quote to SS 
Download the template
Time wise, do only the red part
Agenda 
•CSS b-a-ba 
•Bug? Inspect it! 
•Bring to OSDE 
•Box Model 
•Box placement 
•Vertical Alignment 
•Browser compatibility 
•CSS BestPratices 
•Grids & Media queries
How Layout Works
Rule: Everything is boxes!
Rule: Everything is boxes!
Box model 
Paragraphs live in blockboxes
Box model 
Lists live in blockboxes
Box model
Box model 
Some elements are inline (they run along with the text) and have no dimensions
Rule: Everything is boxes!
Rule: Boxes have dimensions
Box Dimensions
Box Dimensions –width & height
Box Dimensions -border
Box Dimensions -padding
Box Dimensions -margin
Measuring 
All values are editable!
Padding lets you breathe 
border: solid5pxorange; 
background-color: #ffa; 
color: red; 
Looks tight... Let’s give it some padding... 
padding: 20px; 
border: solid5pxorange; 
background-color: #ffa; 
color: red;
width: 200px; 
height: 200px; 
border: solid5pxorange; 
padding: 20px;
W3C Box ModelHeightVisible Height
height: 150px; 
border: solid5pxorange; 
padding: 20px;
W3C Box Model 
div { 
height: 20px; 
padding: 20px; 
border: 20px; 
} 
visible height will be 100px
However... 
... we can change the way the box model works!
width: 200px; 
height: 200px; 
border: solid5pxorange; 
padding: 20px; 
box-sizing: border-box;
Agenda 
•CSS b-a-ba 
•Bug? Inspect it! 
•Bring to OSDE 
•Box Model 
•Box placement 
•Vertical Alignment 
•Browser compatibility 
•CSS BestPratices 
•Grids & Media queries
Laying out the boxes 
http://www.flickr.com/photos/s_volenszki/2218589271
Laying out the boxes
Document and Gravity 
First block... This could be the header 
Second block, this could be the content 
Third block... This could be the footer
Side by Side
Side by Side? 
width: 100px; 
First block... This could be a menu item 
Second block... I want to be a menu item too!
Floats and Clears 
First block... This could be a menu item 
Second block... I want to be a menu item too! 
width: 100px; 
float: left; 
Third block... This could be the footer 
Third block... This could be the footer 
clear: left;
The Clearfix 
First block... This could be a menu item 
Second block... I want to be a menu item too! 
width: 100px; 
float: left; 
Third block... This could be the footer 
clear: both; 
visibility: hidden; 
I am invisible!
“A floated boxis positioned within the normal flow, then taken out of the flow and shifted to the left or right as far as possible. 
(…) 
When a box is taken out of normal flow, all content that is still within normal flow will ignore it completely and not make space for it.” 
Taken from: maxdesign
Floats example 
See example
Avoid using floats 
•They’re messy and you’ll spend a lot of time clearing that mess! (more on this) 
•You will meet them in web tutorials for IE6 and in legacy code over and over again... 
•More info
A better float: inline-block (IE7+) 
First block... This could be a menu item 
Second block... I want to be a menu item too! 
width: 100px; 
display: 
inline-block; 
Third block... This could be the footer 
/* the default */ 
display: block; 
*display:inline; 
*zoom: 1;
Laying out the boxesdisplay: block;
Laying out the boxesdisplay: inline-block;
Floats and Inlines are fluid 
They adapt to whatever space they have
Non-breaking inlines 
•Known dimensions? 
oSet outer container width to the proper dimension 
•Unknown dimensions? (e.g. dynamic content) 
oSet outer container white-space to nowrap 
•Example: 
/CSSShop/floats_and_flow.aspx
Exercise 4 
•This is a no codingexercise! 
•If you can print the next slide 
•Try to layout the context in boxes
Solution Time?
Exercise 5 
•Let’s implement now the previous layout 
•Go to Exercise 5page
Think with boxing in mind (rather than tables)
Think with boxing in mind (rather than tables)
Think with boxing in mind (rather than tables)
Agenda 
•CSS b-a-ba 
•Bug? Inspect it! 
•Bring to OSDE 
•Box Model 
•Box placement 
•Vertical Alignment 
•Browser compatibility 
•CSS BestPratices 
•Grids & Media queries
Vertical Alignment 
•Applied to table cells, changes cell content 
•Applied to images changes the image vertical positioning relative to the line 
•Applied to inline-blocks... depends on the line where the inlinesits (check example) 
Let’sseeanexample
Mastering Positioning
Escaping the gravity,relatively 
First block... 
Second block... 
Third block... This could be the footer 
position: static; 
position: relative; 
top: -100px; 
left: 100px; 
Second block... 
block is kept in the normal flow 
Third block... This could be the footer 
margin-bottom: 
-210px;
Escaping the gravity,absolutely 
First block... 
Third block... This could be the footer 
position: static; 
absolute; 
block is removed from the normal flow... 
The third block moves under it 
Third block... This could be the footer 
Second block... 
Second block... 
left: 100px; 
top: 100px; 
Second block... 
right: 0px; 
bottom: 0px; 
Second block... 
inner 
position: absolute; 
bottom: 0; 
left: 0; 
inner 
Second block 
top: 0; 
inner 
absoluteactually relative to the first parent not static
Positioning 
Relativetakes space, absolutedoesn’t 
Absolutecoordinates are relatively absolute 
You can set dimensions using positioning 
More info
Exercise 6 
•Follow the instruction on page Exercise 6
Exercise 7 
•Follow the instruction on page Exercise 7 
•You may do this exercise directly in the browser inspector.
What about old browsers?
Agenda 
•CSS b-a-ba 
•Bug? Inspect it! 
•Bring to OSDE 
•Box Model 
•Box placement 
•Vertical Alignment 
•Browser compatibility 
•CSS BestPratices 
•Grids & Media queries
Browser compatibility
Browser compatibility
Browser compatibility 
•Everyone’s Chrome version will be higher by the time this presentation ends 
•Firefox, Opera, ..., users are savvy enough to care about updates 
•IE updating resembles installing a new version of Windows, and it is many times controlled by system administrators (on corporate networks)
Browsers behave differently 
Can you live with it? 
Graceful Degradation 
Yes
Graceful Degradation 
Theart of letting go those round corners. 
.c { 
background-image: 
linear-gradient(blue,navy); 
/* fallback to a normal blue */ 
background-color: blue; 
}
Graceful Degradationborder radiusbox shadow inset but we can affordnot having them
Graceful Degradation 
Chrome 
IE 7/8
Browsers behave differently 
Can you live with it? 
Graceful Degradation 
Oh boy... 
Yes 
No
Browsers behave differently 
Oh boy... 
No 
Is there a mainbrowser? 
No 
Find one! 
Install it everywhere! 
Yes
DefiningthebaselineBrowser 
•Define fromstartbrowsers scope 
•Checkthesite analitics
DefiningthebaselineBrowser 
•Define fromstartbrowsers scope 
•Checkthesite analitics 
It’snotenoughto sayIE… Specifytheversionas well! 
(IE7, IE8, …)
Browsers STILLbehavedifferently 
Oh boy... 
No 
Baselinebrowser installed! 
Well… Therewillbealwaysdiferences
Browsers STILLbehavedifferently 
Oh boy... 
No 
Baselinebrowser installed! 
Well… Therewillbealwaysdiferences
Browsers STILLbehavedifferently 
Well… Therewillbealwaysdiferences 
Is IE6support required? 
Yes 
No 
Development time x2 
QA time x2 
Box model works different in IE6 
x3 
And there’s all the bugs that will never be fixed 
x4
FlatteningBrowsers diferences 
•Weapons ofchoice 
oCSS Hacks 
oConditionalCSS 
oModernizr, Polyfills
CSS Hacks 
•Youcanuse hacksifyouhaveto: 
.c {border-radius: 10px; } 
.c{_border: 1px solid black; } 
<= IE6
CSS Hacks 
•Youcanuse hacksifyouhaveto: 
.c {border-radius: 10px; } 
.c{_border: 1px solid black; } 
.c{*border: 1px solid black; } 
<= IE7
CSS Hacks 
•Youcanuse hacksifyouhaveto: 
.c {border-radius: 10px; } 
.c{_border: 1px solid black; } 
.c{*border: 1px solidblack; } 
.c{border: 1px solid black9; } 
<= IE8
CSS Hacks 
•Youcanuse hacksifyouhaveto: 
.c {border-radius: 10px; } 
.c{_border: 1px solid black; } 
.c{*border: 1px solidblack; } 
.c{border: 1px solidblack9; } 
.c{border: 1px solidblack0/; } 
IE8 & IE9
CSS Hacks 
•Youcanuse hacksifyouhaveto: 
.c {border-radius: 10px; } 
.c{_border: 1px solid black; } 
.c{*border: 1px solidblack; } 
.c{border: 1px solidblack9; } 
.c{border: 1px solidblack0/; } 
.c{border: 1px solid black90; } 
IE9
Conditional CSS 
•You can use classes if you want to 
<!--[if IE 7]><scripttype="text/javascript"> 
osjs('html').addClass('ie7'); 
</script><![endif]--> 
.c {border-radius: 10px; } 
.ie7 .c{border: 1px solid black; }
Modernizr 
•Isn’t really what you think it is, sorry. 
•Enables use of HTML5 tags in IE (but we don’t need that) 
•Provides feature detection mechanisms
Modernizr 
•Differentpackages 
•Differentoutputs 
.c {border-radius: 10px; } 
.ie7 .c{border: 1px solid black; }
Polyfills 
Scripts that enhance your browser’s capabilities... But they always come at a cost! 
CSS3 PIE (http://css3pie.com/) 
Other resources (https://github.com/Modernizr/Modernizr/wiki/ HTML5-Cross-Browser-Polyfills)
Polyfills 
•Conditionsto use: 
oSmallchanges 
oFewelements 
•ExampleofusageinOS: PIE
Agenda 
•CSS b-a-ba 
•Bug? Inspect it! 
•Bring to OSDE 
•Box Model 
•Box placement 
•Vertical Alignment 
•Browser compatibility 
•CSS BestPratices 
•Grids & Media queries
Exercise 8 
•Troubleshoot the problem using the inspector 
•Final page should like this:
Exercise 8 solution 
BINGO!
CSS contaminates
CSS contaminatesBrowser defaults -CSS Resets 
•Normalize.css 
ohttp://necolas.github.com/normalize.css/ 
•Reset.css 
ohttp://meyerweb.com/eric/tools/css/reset/
CSS contaminates 
Building a widget library? 
.my-widgets-nav{/* ... */} 
.my-widgets-picker{/* ... */} 
.my-widgets-note{/* ... */} 
Prefix all things!
CSS best practices 
•Organize yourcode: 
oHTML Tags 
oWidgets 
oRichWidgets 
oValidations 
oLayout 
oHeader & Footer 
oMenu 
oOtherClasses 
•Use usefulnamingconventions 
•Reduce& Reuse
Danger of Componentization 
<head> 
<link href="_Basic.css?6430" type="text/css" rel="stylesheet"> 
<link href="/RichWidgets/Blocks/RichWidgets/RichWidgets/Icon.css?8" type="text/css" rel="stylesheet"> 
<link href="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Content/PanelById.css?6430" type="text/css" rel="stylesheet"> 
<link href="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Common/LoginInfo.css?6430" type="text/css" rel="stylesheet"> 
<link href="/RichWidgets/Blocks/RichWidgets/jQueryUI/jQueryUIInternal.css?8" type="text/css" rel="stylesheet"> 
<link href="/RichWidgets/Blocks/RichWidgets/RichWidgets/Feedback_Message.css?8" type="text/css" rel="stylesheet"> 
<link href="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Private/Feedback_AjaxWait.css?6430" type="text/css" rel="stylesheet"> 
<link href="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Patient/ToggleDetails.css?6430" type="text/css" rel="stylesheet"> 
<link href="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Content/PageHead.css?6430" type="text/css" rel="stylesheet"> 
<link href="/RichWidgets/Blocks/RichWidgets/RichWidgets/Input_Calendar.css?8" type="text/css" rel="stylesheet"> 
<link href="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Content/SectionTitle.css?6430" type="text/css" rel="stylesheet"> 
<link href="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Content/ExpandArea.css?6430" type="text/css" rel="stylesheet"> 
<link href="/RichWidgets/Blocks/RichWidgets/RichWidgets/List_SortColumn.css?8" type="text/css" rel="stylesheet"> 
<link href="/RichWidgets/Blocks/RichWidgets/RichWidgets/List_Counter.css?8" type="text/css" rel="stylesheet"> 
<link href="/RichWidgets/Blocks/RichWidgets/RichWidgets/List_Navigation.css?8" type="text/css" rel="stylesheet"> 
<link href="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/ListRecords/LineElement.css?6430" type="text/css" rel="stylesheet"> 
<link href="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/DetailsBlock/Line.css?6430" type="text/css" rel="stylesheet"> 
<link href="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/DetailsBlock/Interaction.css?6430" type="text/css" rel="stylesheet"> 
<link href="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Content/Section.css?6430" type="text/css" rel="stylesheet"> 
<link href="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Tooltips/PopupMenu.css?6430" type="text/css" rel="stylesheet"> 
<link href="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Tooltips/Tooltipster_Tooltip.css?6430" type="text/css" rel="stylesheet"> 
<link href="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Tooltips/Tooltipster_Container.css?6430" type="text/css" rel="stylesheet"> 
<link href="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Deprecated/PopupWindow.css?6430" type="text/css" rel="stylesheet"> 
<link href="Theme.SapphireStyleG_dev.css?6430" type="text/css" rel="stylesheet"> 
<link href="Theme.SapphireStyleG_dev.extra.css?6430" type="text/css" rel="stylesheet"> 
<script src="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Common/MenuRight.js?6430" type="text/javascript" charset="UTF-8"></script> 
<script src="/SapphireStyleG_dev/Blocks/RichWidgets/jQueryUI/jQueryUIInternal.en.js?8" type="text/javascript" charset="UTF-8"></script> 
<script src="/SapphireStyleG_dev/Blocks/RichWidgets/jQueryUI/jQueryComponents.en.js?8" type="text/javascript" charset="UTF-8"></script> 
<script src="/SapphireStyleG_dev/Blocks/RichWidgets/jQueryUI/jQueryCookie.en.js?8" type="text/javascript" charset="UTF-8"></script> 
<script src="/SapphireStyleG_dev/Blocks/RichWidgets/jQueryUI/jQueryCurvycorners.en.js?8" type="text/javascript" charset="UTF-8"></script> 
<script src="/SapphireStyleG_dev/Blocks/RichWidgets/RichWidgets/Feedback_Message.en.js?8" type="text/javascript" charset="UTF-8"></script> 
<script src="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Private/Feedback_AjaxWait.js?6430" type="text/javascript" charset="UTF-8"></script> 
<script src="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Layouts/Layout.js?6430" type="text/javascript" charset="UTF-8"></script> 
<script src="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Patient/ToggleDetails.js?6430" type="text/javascript" charset="UTF-8"></script> 
<script src="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Patient/PatientDetails.js?6430" type="text/javascript" charset="UTF-8"></script> 
<script src="/SapphireStyleG_dev/Blocks/RichWidgets/RichWidgets/Input_Calendar.en.js?8" type="text/javascript" charset="UTF-8"></script> 
<script src="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Content/TabsClient.js?6430" type="text/javascript" charset="UTF-8"></script> 
<script src="/SapphireStyleG_dev/Blocks/RichWidgets/RichWidgets/List_SortColumn.en.js?8" type="text/javascript" charset="UTF-8"></script> 
<script src="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Content/PanelById.js?6430" type="text/javascript" charset="UTF-8"></script> 
<script src="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Tooltips/PopupMenu.js?6430" type="text/javascript" charset="UTF-8"></script> 
<script src="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Javascript/Tooltipster.js?6430" type="text/javascript" charset="UTF-8"></script> 
<script src="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Tooltips/Tooltipster_Tooltip.js?6430" type="text/javascript" charset="UTF-8"></script> 
<script src="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Deprecated/PopupWindow.js?6430" type="text/javascript" charset="UTF-8"></script> 
</head> IE 7/8 
only import (css+JS) 30files
Agenda 
•CSS b-a-ba 
•Bug? Inspect it! 
•Bring to OSDE 
•Box Model 
•Box placement 
•Vertical Alignment 
•Browser compatibility 
•CSS BestPratices 
•Grids & Media queries
Platform Grid
Platform Grid Problems?
Fluid but not entirely
Why not entirelly? 
For more details check this post
Media Queries 
“allows the content rendering to adapt to conditions such as screen resolution“
Media queries
Media queries syntax 
Learn more @ MDN
RWD?!
“responsive web design isn’tintended to serve as a replacementfor mobile web sites”
Exercise 9 
•Duplicate the page Exercise 5 
•Rename it Exercise 9 
•The exercise is to make this page Responsive 
•Needs to be responsive to all devices
Final Thoughts
Be Pragmatic 
•If CSS gets in your way, go the other way 
oExample: vertically centering 
•Use CSS as a fast-prototyping tool 
oIf old browsers get too quirky, print-screen and use images!
No magic
Inspect everything
CSS in your favor(fast prototyping), never against you!
Rúben Gonçalves 
ruben.goncalves@outsystems.com 
?
References 
•Compatibilityquickreference 
•Checkifyoucanuse anelement 
•MostcommonIE Bugs 
•Cross-browser CSS 
•Normalize.css 
•CSS Reset 
•W3C CSS& HTMLvalidator 
•Selectors
References 
•CSS Positioning 101 
•CSS Floats 
•Containing Floats 
•960 Grid System 
•Twitter’s Bootstrap 
•Basic CSS layouts(learn by view-source) 
•A ton of CSS Snippets(from css-tricks.com) 
•Modernizrlist of Polyfills
References 
•CSS 3 Modules (MDN) 
•CSS 3 Demo Studio

More Related Content

What's hot

OutSystems Tricks & Tips for Complex UI Integrations
OutSystems Tricks & Tips for Complex UI IntegrationsOutSystems Tricks & Tips for Complex UI Integrations
OutSystems Tricks & Tips for Complex UI IntegrationsOutSystems
 
Multi tenancy - a practical approach
Multi tenancy - a practical approachMulti tenancy - a practical approach
Multi tenancy - a practical approachCatarinaPereira64715
 
Advanced Bootstrapping and Integrations - Chennai OutSystems User Group 27th ...
Advanced Bootstrapping and Integrations - Chennai OutSystems User Group 27th ...Advanced Bootstrapping and Integrations - Chennai OutSystems User Group 27th ...
Advanced Bootstrapping and Integrations - Chennai OutSystems User Group 27th ...OutSystemsNeo
 
Reactive Web Best Practices
Reactive Web Best PracticesReactive Web Best Practices
Reactive Web Best PracticesOutSystems
 
OutSystems Tips and Tricks
OutSystems Tips and TricksOutSystems Tips and Tricks
OutSystems Tips and TricksOutSystems
 
Building CRUD Wrappers
Building CRUD WrappersBuilding CRUD Wrappers
Building CRUD WrappersOutSystems
 
Growing and Scaling OutSystems
Growing and Scaling OutSystemsGrowing and Scaling OutSystems
Growing and Scaling OutSystemsOutSystems
 
Service Actions
Service ActionsService Actions
Service ActionsOutSystems
 
Create Amazing Reports in OutSystems
Create Amazing Reports in OutSystemsCreate Amazing Reports in OutSystems
Create Amazing Reports in OutSystemsOutSystems
 
Tenants: A Look Behind the Scenes
Tenants: A Look Behind the ScenesTenants: A Look Behind the Scenes
Tenants: A Look Behind the ScenesOutSystems
 
Using Processes and Timers for Long-Running Asynchronous Tasks
Using Processes and Timers for Long-Running Asynchronous TasksUsing Processes and Timers for Long-Running Asynchronous Tasks
Using Processes and Timers for Long-Running Asynchronous TasksOutSystems
 
Building frameworks: from concept to completion
Building frameworks: from concept to completionBuilding frameworks: from concept to completion
Building frameworks: from concept to completionRuben Goncalves
 
Hands on With Advanced Data Grid
Hands on With Advanced Data GridHands on With Advanced Data Grid
Hands on With Advanced Data GridOutSystems
 
Training Webinar: Top front-end techniques for OutSystems
 Training Webinar: Top front-end techniques for OutSystems Training Webinar: Top front-end techniques for OutSystems
Training Webinar: Top front-end techniques for OutSystemsOutSystems
 
Training Webinar: Fitting OutSystems applications into Enterprise Architecture
Training Webinar: Fitting OutSystems applications into Enterprise ArchitectureTraining Webinar: Fitting OutSystems applications into Enterprise Architecture
Training Webinar: Fitting OutSystems applications into Enterprise ArchitectureOutSystems
 
OutSystems Front End Specialization - Study Help Deck
OutSystems Front End Specialization - Study Help DeckOutSystems Front End Specialization - Study Help Deck
OutSystems Front End Specialization - Study Help DeckFábio Godinho
 
Training Webinars - Secret hacks for OutSystems 10
Training Webinars - Secret hacks for OutSystems 10Training Webinars - Secret hacks for OutSystems 10
Training Webinars - Secret hacks for OutSystems 10OutSystems
 
Unattended OutSystems Installation
Unattended OutSystems InstallationUnattended OutSystems Installation
Unattended OutSystems InstallationOutSystems
 
OutSystems User Groups - Introduction to OutSystems Architecture (Pune - 7 A...
 OutSystems User Groups - Introduction to OutSystems Architecture (Pune - 7 A... OutSystems User Groups - Introduction to OutSystems Architecture (Pune - 7 A...
OutSystems User Groups - Introduction to OutSystems Architecture (Pune - 7 A...OutSystemsNeo
 

What's hot (20)

OutSystems Tricks & Tips for Complex UI Integrations
OutSystems Tricks & Tips for Complex UI IntegrationsOutSystems Tricks & Tips for Complex UI Integrations
OutSystems Tricks & Tips for Complex UI Integrations
 
Multi tenancy - a practical approach
Multi tenancy - a practical approachMulti tenancy - a practical approach
Multi tenancy - a practical approach
 
Advanced Bootstrapping and Integrations - Chennai OutSystems User Group 27th ...
Advanced Bootstrapping and Integrations - Chennai OutSystems User Group 27th ...Advanced Bootstrapping and Integrations - Chennai OutSystems User Group 27th ...
Advanced Bootstrapping and Integrations - Chennai OutSystems User Group 27th ...
 
Reactive Web Best Practices
Reactive Web Best PracticesReactive Web Best Practices
Reactive Web Best Practices
 
OutSystems Tips and Tricks
OutSystems Tips and TricksOutSystems Tips and Tricks
OutSystems Tips and Tricks
 
Building CRUD Wrappers
Building CRUD WrappersBuilding CRUD Wrappers
Building CRUD Wrappers
 
Growing and Scaling OutSystems
Growing and Scaling OutSystemsGrowing and Scaling OutSystems
Growing and Scaling OutSystems
 
Service Actions
Service ActionsService Actions
Service Actions
 
Create Amazing Reports in OutSystems
Create Amazing Reports in OutSystemsCreate Amazing Reports in OutSystems
Create Amazing Reports in OutSystems
 
OutSystems Platform Troubleshooting
OutSystems Platform TroubleshootingOutSystems Platform Troubleshooting
OutSystems Platform Troubleshooting
 
Tenants: A Look Behind the Scenes
Tenants: A Look Behind the ScenesTenants: A Look Behind the Scenes
Tenants: A Look Behind the Scenes
 
Using Processes and Timers for Long-Running Asynchronous Tasks
Using Processes and Timers for Long-Running Asynchronous TasksUsing Processes and Timers for Long-Running Asynchronous Tasks
Using Processes and Timers for Long-Running Asynchronous Tasks
 
Building frameworks: from concept to completion
Building frameworks: from concept to completionBuilding frameworks: from concept to completion
Building frameworks: from concept to completion
 
Hands on With Advanced Data Grid
Hands on With Advanced Data GridHands on With Advanced Data Grid
Hands on With Advanced Data Grid
 
Training Webinar: Top front-end techniques for OutSystems
 Training Webinar: Top front-end techniques for OutSystems Training Webinar: Top front-end techniques for OutSystems
Training Webinar: Top front-end techniques for OutSystems
 
Training Webinar: Fitting OutSystems applications into Enterprise Architecture
Training Webinar: Fitting OutSystems applications into Enterprise ArchitectureTraining Webinar: Fitting OutSystems applications into Enterprise Architecture
Training Webinar: Fitting OutSystems applications into Enterprise Architecture
 
OutSystems Front End Specialization - Study Help Deck
OutSystems Front End Specialization - Study Help DeckOutSystems Front End Specialization - Study Help Deck
OutSystems Front End Specialization - Study Help Deck
 
Training Webinars - Secret hacks for OutSystems 10
Training Webinars - Secret hacks for OutSystems 10Training Webinars - Secret hacks for OutSystems 10
Training Webinars - Secret hacks for OutSystems 10
 
Unattended OutSystems Installation
Unattended OutSystems InstallationUnattended OutSystems Installation
Unattended OutSystems Installation
 
OutSystems User Groups - Introduction to OutSystems Architecture (Pune - 7 A...
 OutSystems User Groups - Introduction to OutSystems Architecture (Pune - 7 A... OutSystems User Groups - Introduction to OutSystems Architecture (Pune - 7 A...
OutSystems User Groups - Introduction to OutSystems Architecture (Pune - 7 A...
 

Viewers also liked

Mobile Location workshop
Mobile Location workshopMobile Location workshop
Mobile Location workshopRuben Goncalves
 
CSS Basic and Tips
CSS Basic and TipsCSS Basic and Tips
CSS Basic and Tipsnyatto73
 
Training Webinar: Enterprise application performance with distributed caching
Training Webinar: Enterprise application performance with distributed cachingTraining Webinar: Enterprise application performance with distributed caching
Training Webinar: Enterprise application performance with distributed cachingOutSystems
 
Five fantastic tips for fabulous phone photos
Five fantastic tips for fabulous phone photosFive fantastic tips for fabulous phone photos
Five fantastic tips for fabulous phone photosSmallAperture
 
Usability session @ SEI Universidade do Minho
Usability session @ SEI Universidade do MinhoUsability session @ SEI Universidade do Minho
Usability session @ SEI Universidade do MinhoRuben Goncalves
 
Dos and Don'ts on the road to Mobility
Dos and Don'ts on the road to MobilityDos and Don'ts on the road to Mobility
Dos and Don'ts on the road to MobilityRuben Goncalves
 
Effective c++chapter3
Effective c++chapter3Effective c++chapter3
Effective c++chapter3성연 김
 
Benevole e newsletter jan 2015
Benevole e newsletter jan 2015Benevole e newsletter jan 2015
Benevole e newsletter jan 2015Ramabhau Patil
 
Benevole e newsletter march 2015
Benevole e newsletter march 2015Benevole e newsletter march 2015
Benevole e newsletter march 2015Ramabhau Patil
 
Plugin smilk : données liées et traitement de la langue pour améliorer la nav...
Plugin smilk : données liées et traitement de la langue pour améliorer la nav...Plugin smilk : données liées et traitement de la langue pour améliorer la nav...
Plugin smilk : données liées et traitement de la langue pour améliorer la nav...SemWebPro
 

Viewers also liked (18)

Mobile Location workshop
Mobile Location workshopMobile Location workshop
Mobile Location workshop
 
CSS Basic and Tips
CSS Basic and TipsCSS Basic and Tips
CSS Basic and Tips
 
Training Webinar: Enterprise application performance with distributed caching
Training Webinar: Enterprise application performance with distributed cachingTraining Webinar: Enterprise application performance with distributed caching
Training Webinar: Enterprise application performance with distributed caching
 
Five fantastic tips for fabulous phone photos
Five fantastic tips for fabulous phone photosFive fantastic tips for fabulous phone photos
Five fantastic tips for fabulous phone photos
 
Usability session @ SEI Universidade do Minho
Usability session @ SEI Universidade do MinhoUsability session @ SEI Universidade do Minho
Usability session @ SEI Universidade do Minho
 
AM
AM AM
AM
 
My Assignment.pptx
My Assignment.pptxMy Assignment.pptx
My Assignment.pptx
 
развеселый торг
развеселый торгразвеселый торг
развеселый торг
 
Dos and Don'ts on the road to Mobility
Dos and Don'ts on the road to MobilityDos and Don'ts on the road to Mobility
Dos and Don'ts on the road to Mobility
 
Effective c++chapter3
Effective c++chapter3Effective c++chapter3
Effective c++chapter3
 
Thunder – jessie j
Thunder – jessie jThunder – jessie j
Thunder – jessie j
 
Windows 8
Windows 8 Windows 8
Windows 8
 
Benevole e newsletter jan 2015
Benevole e newsletter jan 2015Benevole e newsletter jan 2015
Benevole e newsletter jan 2015
 
Benevole e newsletter march 2015
Benevole e newsletter march 2015Benevole e newsletter march 2015
Benevole e newsletter march 2015
 
Plugin smilk : données liées et traitement de la langue pour améliorer la nav...
Plugin smilk : données liées et traitement de la langue pour améliorer la nav...Plugin smilk : données liées et traitement de la langue pour améliorer la nav...
Plugin smilk : données liées et traitement de la langue pour améliorer la nav...
 
Whizzingwords
WhizzingwordsWhizzingwords
Whizzingwords
 
Heol
HeolHeol
Heol
 
Emisoft
EmisoftEmisoft
Emisoft
 

Similar to CSS workshop @ OutSystems

Getting Started With CSS
Getting Started With CSSGetting Started With CSS
Getting Started With CSSTrisha Crowley
 
Advanced CSS Troubleshooting
Advanced CSS TroubleshootingAdvanced CSS Troubleshooting
Advanced CSS TroubleshootingDenise Jacobs
 
Web design-workflow
Web design-workflowWeb design-workflow
Web design-workflowPeter Kaizer
 
Css methods architecture
Css methods architectureCss methods architecture
Css methods architectureLasha Sumbadze
 
Cascading Style Sheets - CSS
Cascading Style Sheets - CSSCascading Style Sheets - CSS
Cascading Style Sheets - CSSSun Technlogies
 
Advanced sass/compass
Advanced sass/compassAdvanced sass/compass
Advanced sass/compassNick Cooley
 
Oooh shiny
Oooh shinyOooh shiny
Oooh shinywcto2017
 
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892Deepak Sharma
 
Css best practices style guide and tips
Css best practices style guide and tipsCss best practices style guide and tips
Css best practices style guide and tipsChris Love
 
Blackboard DevCon 2011 - Performance Considerations for Custom Theme Development
Blackboard DevCon 2011 - Performance Considerations for Custom Theme DevelopmentBlackboard DevCon 2011 - Performance Considerations for Custom Theme Development
Blackboard DevCon 2011 - Performance Considerations for Custom Theme DevelopmentNoriaki Tatsumi
 
CSS Framework + Progressive Enhacements
CSS Framework + Progressive EnhacementsCSS Framework + Progressive Enhacements
CSS Framework + Progressive EnhacementsMario Hernandez
 
The web standards gentleman: a matter of (evolving) standards)
The web standards gentleman: a matter of (evolving) standards)The web standards gentleman: a matter of (evolving) standards)
The web standards gentleman: a matter of (evolving) standards)Chris Mills
 
The Future State of Layout
The Future State of LayoutThe Future State of Layout
The Future State of LayoutStephen Hay
 
Modular HTML & CSS
Modular HTML & CSSModular HTML & CSS
Modular HTML & CSSShay Howe
 

Similar to CSS workshop @ OutSystems (20)

Getting Started With CSS
Getting Started With CSSGetting Started With CSS
Getting Started With CSS
 
Dangerous CSS
Dangerous CSSDangerous CSS
Dangerous CSS
 
Advanced CSS Troubleshooting
Advanced CSS TroubleshootingAdvanced CSS Troubleshooting
Advanced CSS Troubleshooting
 
Web design-workflow
Web design-workflowWeb design-workflow
Web design-workflow
 
Css methods architecture
Css methods architectureCss methods architecture
Css methods architecture
 
Cascading Style Sheets - CSS
Cascading Style Sheets - CSSCascading Style Sheets - CSS
Cascading Style Sheets - CSS
 
Advanced sass/compass
Advanced sass/compassAdvanced sass/compass
Advanced sass/compass
 
Oooh shiny
Oooh shinyOooh shiny
Oooh shiny
 
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
Cssbestpracticesjstyleguidejandtips 150830184202-lva1-app6892
 
Css best practices style guide and tips
Css best practices style guide and tipsCss best practices style guide and tips
Css best practices style guide and tips
 
Blackboard DevCon 2011 - Performance Considerations for Custom Theme Development
Blackboard DevCon 2011 - Performance Considerations for Custom Theme DevelopmentBlackboard DevCon 2011 - Performance Considerations for Custom Theme Development
Blackboard DevCon 2011 - Performance Considerations for Custom Theme Development
 
Web
WebWeb
Web
 
Css intro
Css introCss intro
Css intro
 
CSS Framework + Progressive Enhacements
CSS Framework + Progressive EnhacementsCSS Framework + Progressive Enhacements
CSS Framework + Progressive Enhacements
 
The web standards gentleman: a matter of (evolving) standards)
The web standards gentleman: a matter of (evolving) standards)The web standards gentleman: a matter of (evolving) standards)
The web standards gentleman: a matter of (evolving) standards)
 
ARTDM 171, Week 5: CSS
ARTDM 171, Week 5: CSSARTDM 171, Week 5: CSS
ARTDM 171, Week 5: CSS
 
The Future State of Layout
The Future State of LayoutThe Future State of Layout
The Future State of Layout
 
Modular HTML & CSS
Modular HTML & CSSModular HTML & CSS
Modular HTML & CSS
 
slides-students-C04.pdf
slides-students-C04.pdfslides-students-C04.pdf
slides-students-C04.pdf
 
Css 3
Css 3Css 3
Css 3
 

More from Ruben Goncalves

Programming as a form of art
Programming as a form of artProgramming as a form of art
Programming as a form of artRuben Goncalves
 
Creating Mobile Apps like a BOSS
Creating Mobile Apps like a BOSSCreating Mobile Apps like a BOSS
Creating Mobile Apps like a BOSSRuben Goncalves
 
The real impact of mobility on your business apps
The real impact of mobility on your business appsThe real impact of mobility on your business apps
The real impact of mobility on your business appsRuben Goncalves
 
Delivering Mobile Apps That Perform
Delivering Mobile Apps That PerformDelivering Mobile Apps That Perform
Delivering Mobile Apps That PerformRuben Goncalves
 
Hardcore Mobile integrations
Hardcore Mobile integrationsHardcore Mobile integrations
Hardcore Mobile integrationsRuben Goncalves
 
Become a mobile developer from scratch
Become a mobile developer from scratchBecome a mobile developer from scratch
Become a mobile developer from scratchRuben Goncalves
 
Grids and Visual hierarchy for developers
Grids and Visual hierarchy for developers Grids and Visual hierarchy for developers
Grids and Visual hierarchy for developers Ruben Goncalves
 

More from Ruben Goncalves (7)

Programming as a form of art
Programming as a form of artProgramming as a form of art
Programming as a form of art
 
Creating Mobile Apps like a BOSS
Creating Mobile Apps like a BOSSCreating Mobile Apps like a BOSS
Creating Mobile Apps like a BOSS
 
The real impact of mobility on your business apps
The real impact of mobility on your business appsThe real impact of mobility on your business apps
The real impact of mobility on your business apps
 
Delivering Mobile Apps That Perform
Delivering Mobile Apps That PerformDelivering Mobile Apps That Perform
Delivering Mobile Apps That Perform
 
Hardcore Mobile integrations
Hardcore Mobile integrationsHardcore Mobile integrations
Hardcore Mobile integrations
 
Become a mobile developer from scratch
Become a mobile developer from scratchBecome a mobile developer from scratch
Become a mobile developer from scratch
 
Grids and Visual hierarchy for developers
Grids and Visual hierarchy for developers Grids and Visual hierarchy for developers
Grids and Visual hierarchy for developers
 

Recently uploaded

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Recently uploaded (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

CSS workshop @ OutSystems

  • 1. CSS Shop Learn yourself some CSS, the fast way.
  • 2. WhoamI? Rúben Gonçalves A CSS lover@ OutSystems ruben.goncalves@outsystems.com rubengoncalves Kudosto Marco Costa andMiguel Ventura for makingthispossible.
  • 3. "Any technology sufficiently advanced is indistinguishable from magic." -Arthur C. Clark No Magic.
  • 5. Agenda •CSS b-a-ba •Bug? Inspect it! •Bring to OSDE •Box Model •Box placement •Vertical Alignment •Browser compatibility •CSS BestPratices •Grids & Media queries *OSDE –OutSystems Development Environment
  • 6. Agenda •CSS b-a-ba •Bug? Inspect it! •Bring to OSDE •Box Model •Box placement •Vertical Alignment •Browser compatibility •CSS BestPratices •Grids & Media queries
  • 7. The Web “three leg stool” JavaScript HTML Colors, backgrounds, formatting, positioning, … Additional ways for the user to interact with the application Content, Data, Containers and Tables Structure Presentation Behaviour CSS
  • 8. CSS stands for? CSS = CascadingStyleSheets WHY ? Browser Author User !important It’s all about: What ruleto apply to a certain element ais blue a is red ais gray ais purple
  • 9. But why CSS? •A clear separation of presentation and content •A set of rules telling the browser how to display elements •Allows the sharing of style sheets across documents •Makes it easy to "skin" a web site (theme)
  • 10. Syntax 101 <selector> { <property>: <value>; <property>: <value>; ... }
  • 11. Syntax 101 -Selectors •by tag, like div •by class, like .MainContent •by id, like #wt13_wtMainContent •by pseudo-class, like :hover •by attribute, like [disabled]or [type=checkbox] <divid="wt13_wtMainContent"class="MainContent"> <inputtype="checkbox"disabled/>
  • 12. Syntax 101 -Selectors •by tag, like div •by class, like .MainContent •by id, like #wt13_wtMainContent •by pseudo-class, like :hover •by attribute, like [disabled]or [type=checkbox] <divid="wt13_wtMainContent"class="MainContent"> <inputtype="checkbox"disabled/>
  • 13. Syntax 101 -Selectors •by tag, like div •by class, like .MainContent •by id, like #wt13_wtMainContent •by pseudo-class, like :hover •by attribute, like [disabled]or [type=checkbox] <divid="wt13_wtMainContent"class="MainContent"> <inputtype="checkbox"disabled/>
  • 14. Syntax 101 -Selectors •by tag, like div •by class, like .MainContent •by id, like #wt13_wtMainContent •by pseudo-class, like :hover •by attribute, like [disabled]or [type=checkbox] <divid="wt13_wtMainContent"class="MainContent"> <inputtype="checkbox"disabled/>
  • 15. Syntax 101 -Selectors •by tag, like div •by class, like .MainContent •by id, like #wt13_wtMainContent •by pseudo-class, like :hover •by attribute, like [disabled]or [type=checkbox] <divid="wt13_wtMainContent"class="MainContent"> <inputtype="checkbox"disabled/>
  • 16. Syntax 101 –Selectors •by pseudo-class: o.MainContent >:first-child o.MainContent >:last-child <divid="wt13_wtMainContent"class="MainContent"> <inputtype="checkbox"disabled/> <inputtype="text"/> <div> <inputtype="text"/> </div> </div>
  • 17. Syntax 101 –Selectors •by pseudo-class: o.MainContent >:first-child o.MainContent >:last-child <divid="wt13_wtMainContent"class="MainContent"> <inputtype="checkbox"disabled/> <inputtype="text"/> <div> <inputtype="text"/> </div> </div>
  • 18. Syntax 101 –Selectors •by pseudo-class: o.MainContent >:first-child o.MainContent >:last-child •by parent: o.MainContent> input[Type=“text”] o.MainContentinput o.MainContentinput + input <divid="wt13_wtMainContent"class="MainContent"> <inputtype="checkbox"disabled/> <inputtype="text"/> <div> <inputtype="text"/> </div> </div>
  • 19. Syntax 101 –Selectors •by pseudo-class: o.MainContent >:first-child o.MainContent >:last-child •by parent: o.MainContent> input[Type=“text”] o.MainContentinput o.MainContentinput + input <divid="wt13_wtMainContent"class="MainContent"> <inputtype="checkbox"disabled/> <inputtype="text"/> <div> <inputtype="text"/> </div> </div>
  • 20. Syntax 101 –Selectors •by pseudo-class: o.MainContent >:first-child o.MainContent >:last-child •by parent: o.MainContent> input[Type=“text”] o.MainContentinput o.MainContentinput + input <divid="wt13_wtMainContent"class="MainContent"> <inputtype="checkbox"disabled/> <inputtype="text"/> <div> <inputtype="text"/> </div> </div>
  • 22. Syntax 101 -Selector COMBOs •Apply same style to many selectors oselector 1,selector 2
  • 23. Syntax 101 -Selector COMBOs •Apply same style to many selectors oselector 1,selector 2 •Elements one inside another o.head .title{ font-size: xx-large; }
  • 24. Syntax 101 -Selector COMBOs •Apply same style to many selectors oselector 1,selector 2 •Elements one inside another o.head .title{ font-size: xx-large; } •By tag, class, with two attributes oinput.big[type=checkbox][disabled]{ cursor: not-allowed; }
  • 25. Syntax 101 -Selector COMBOs #container div.deployButton a:hover, #container div.deployButton input[disabled]:active{ background-color: red; } Let’sseetheeffect
  • 26. Syntax 101 –Rule Priority •Most specific wins 1.style=“value” 2.#someid 3..classor [attributes] 4.tags 5.*
  • 27. Specs say: Use #IDsto apply style to single element Use .classto apply style to a class of elements But in OutSystems IDs are generated dynamically --you can't predict them… So use classes everywhere instead. PROBLEM SOLVED! OutSystems Checkpoint
  • 28. Syntax 101 –Rule Priority •Definitionordermatters
  • 31. Syntax 101 –Rule Priority Example <divclass="outer"id="outerdiv"> <divclass="inner"id="innerdiv1"> hello </div> </div> Let’sseetheeffect
  • 32. Syntax 101 -Properties •Text properties ofont (size, weight, style), color, transform, spacing, line, align, direction •Background ocolors, images, patterns •Box owidth, height, margin, border, shadow •Layout opositioning, visibility, overflow, white-space, floating
  • 33. Syntax 101 -Properties Thinking of doing X? There's probably a CSS property for that. Good references: •W3C CSS spec •MDN
  • 34. Exercise 0 •Get your gear http://goo.gl/ql8CHD •Login to your personal environment •Publish the eSpace CSSShop •Except requested, all css should be done in the respective Page.
  • 35. Exercise 1 •Follow the instruction on page Exercise1
  • 36. Exercise 2 •Follow the instruction on page Exercise2
  • 37. Agenda •CSS b-a-ba •Bug? Inspect it! •Bring to OSDE •Box Model •Box placement •Vertical Alignment •Browser compatibility •CSS BestPratices •Grids & Media queries
  • 39. You need instant feedback... Uhh... Where was I?
  • 43. CSS3 Eye candy effects
  • 44. CSS3 Eye candy effects And lots of really useful stuff Transforms, transitions, animations, gradients, multiple columns, multiple backgrounds, counters, flexboxes, speech, fonts, ...
  • 45. CSS3 Cool Experimental Use with caution
  • 46. Agenda •CSS b-a-ba •Bug? Inspect it! •Bring to OSDE •Box Model •Box placement •Vertical Alignment •Browser compatibility •CSS BestPratices •Grids & Media queries
  • 47. Some markup you find as example in the internet is hard to reproduce in SS, such as lists or HTML5 elements: <section> <header> <nav> <ul> <li>...</li> <li>...</li> </ul> </nav> </header> </section> But do you need it? OutSystems Checkpoint
  • 48. Converting from a template: classify everything! <sectionid="sec01"class="first"> markup styles section{font-weight: bold; } #sec01{font-style: italic; }
  • 49. Converting from a template: classify everything! <sectionid="sec01"class="first"> markup styles .tag-section{font-weight: bold; } .id-sec01 {font-style: italic; }
  • 50. Converting from a template: classify everything! markup styles .tag-section{font-weight: bold; } .id-sec01 {font-style: italic; } <div class="first tag-section id-sec01">
  • 51. How about the widget tree?
  • 52. Exercise 3 •Our customer’s webdesigner handed us a bunch of HTML and CSS files •You should convert everything to the OutSystems platform visual design tool! •Use TemplateToSSminimalism-template •Convert the whole header portion, including the DaVinci quote to SS Download the template
  • 53. Time wise, do only the red part
  • 54. Agenda •CSS b-a-ba •Bug? Inspect it! •Bring to OSDE •Box Model •Box placement •Vertical Alignment •Browser compatibility •CSS BestPratices •Grids & Media queries
  • 58. Box model Paragraphs live in blockboxes
  • 59. Box model Lists live in blockboxes
  • 61. Box model Some elements are inline (they run along with the text) and have no dimensions
  • 63. Rule: Boxes have dimensions
  • 69. Measuring All values are editable!
  • 70. Padding lets you breathe border: solid5pxorange; background-color: #ffa; color: red; Looks tight... Let’s give it some padding... padding: 20px; border: solid5pxorange; background-color: #ffa; color: red;
  • 71. width: 200px; height: 200px; border: solid5pxorange; padding: 20px;
  • 73. height: 150px; border: solid5pxorange; padding: 20px;
  • 74. W3C Box Model div { height: 20px; padding: 20px; border: 20px; } visible height will be 100px
  • 75. However... ... we can change the way the box model works!
  • 76. width: 200px; height: 200px; border: solid5pxorange; padding: 20px; box-sizing: border-box;
  • 77. Agenda •CSS b-a-ba •Bug? Inspect it! •Bring to OSDE •Box Model •Box placement •Vertical Alignment •Browser compatibility •CSS BestPratices •Grids & Media queries
  • 78. Laying out the boxes http://www.flickr.com/photos/s_volenszki/2218589271
  • 79. Laying out the boxes
  • 80. Document and Gravity First block... This could be the header Second block, this could be the content Third block... This could be the footer
  • 82. Side by Side? width: 100px; First block... This could be a menu item Second block... I want to be a menu item too!
  • 83. Floats and Clears First block... This could be a menu item Second block... I want to be a menu item too! width: 100px; float: left; Third block... This could be the footer Third block... This could be the footer clear: left;
  • 84. The Clearfix First block... This could be a menu item Second block... I want to be a menu item too! width: 100px; float: left; Third block... This could be the footer clear: both; visibility: hidden; I am invisible!
  • 85. “A floated boxis positioned within the normal flow, then taken out of the flow and shifted to the left or right as far as possible. (…) When a box is taken out of normal flow, all content that is still within normal flow will ignore it completely and not make space for it.” Taken from: maxdesign
  • 87. Avoid using floats •They’re messy and you’ll spend a lot of time clearing that mess! (more on this) •You will meet them in web tutorials for IE6 and in legacy code over and over again... •More info
  • 88. A better float: inline-block (IE7+) First block... This could be a menu item Second block... I want to be a menu item too! width: 100px; display: inline-block; Third block... This could be the footer /* the default */ display: block; *display:inline; *zoom: 1;
  • 89. Laying out the boxesdisplay: block;
  • 90. Laying out the boxesdisplay: inline-block;
  • 91. Floats and Inlines are fluid They adapt to whatever space they have
  • 92. Non-breaking inlines •Known dimensions? oSet outer container width to the proper dimension •Unknown dimensions? (e.g. dynamic content) oSet outer container white-space to nowrap •Example: /CSSShop/floats_and_flow.aspx
  • 93. Exercise 4 •This is a no codingexercise! •If you can print the next slide •Try to layout the context in boxes
  • 94.
  • 96.
  • 97. Exercise 5 •Let’s implement now the previous layout •Go to Exercise 5page
  • 98. Think with boxing in mind (rather than tables)
  • 99. Think with boxing in mind (rather than tables)
  • 100. Think with boxing in mind (rather than tables)
  • 101. Agenda •CSS b-a-ba •Bug? Inspect it! •Bring to OSDE •Box Model •Box placement •Vertical Alignment •Browser compatibility •CSS BestPratices •Grids & Media queries
  • 102. Vertical Alignment •Applied to table cells, changes cell content •Applied to images changes the image vertical positioning relative to the line •Applied to inline-blocks... depends on the line where the inlinesits (check example) Let’sseeanexample
  • 104. Escaping the gravity,relatively First block... Second block... Third block... This could be the footer position: static; position: relative; top: -100px; left: 100px; Second block... block is kept in the normal flow Third block... This could be the footer margin-bottom: -210px;
  • 105. Escaping the gravity,absolutely First block... Third block... This could be the footer position: static; absolute; block is removed from the normal flow... The third block moves under it Third block... This could be the footer Second block... Second block... left: 100px; top: 100px; Second block... right: 0px; bottom: 0px; Second block... inner position: absolute; bottom: 0; left: 0; inner Second block top: 0; inner absoluteactually relative to the first parent not static
  • 106. Positioning Relativetakes space, absolutedoesn’t Absolutecoordinates are relatively absolute You can set dimensions using positioning More info
  • 107. Exercise 6 •Follow the instruction on page Exercise 6
  • 108. Exercise 7 •Follow the instruction on page Exercise 7 •You may do this exercise directly in the browser inspector.
  • 109. What about old browsers?
  • 110. Agenda •CSS b-a-ba •Bug? Inspect it! •Bring to OSDE •Box Model •Box placement •Vertical Alignment •Browser compatibility •CSS BestPratices •Grids & Media queries
  • 113. Browser compatibility •Everyone’s Chrome version will be higher by the time this presentation ends •Firefox, Opera, ..., users are savvy enough to care about updates •IE updating resembles installing a new version of Windows, and it is many times controlled by system administrators (on corporate networks)
  • 114. Browsers behave differently Can you live with it? Graceful Degradation Yes
  • 115. Graceful Degradation Theart of letting go those round corners. .c { background-image: linear-gradient(blue,navy); /* fallback to a normal blue */ background-color: blue; }
  • 116. Graceful Degradationborder radiusbox shadow inset but we can affordnot having them
  • 118. Browsers behave differently Can you live with it? Graceful Degradation Oh boy... Yes No
  • 119. Browsers behave differently Oh boy... No Is there a mainbrowser? No Find one! Install it everywhere! Yes
  • 120. DefiningthebaselineBrowser •Define fromstartbrowsers scope •Checkthesite analitics
  • 121. DefiningthebaselineBrowser •Define fromstartbrowsers scope •Checkthesite analitics It’snotenoughto sayIE… Specifytheversionas well! (IE7, IE8, …)
  • 122. Browsers STILLbehavedifferently Oh boy... No Baselinebrowser installed! Well… Therewillbealwaysdiferences
  • 123. Browsers STILLbehavedifferently Oh boy... No Baselinebrowser installed! Well… Therewillbealwaysdiferences
  • 124. Browsers STILLbehavedifferently Well… Therewillbealwaysdiferences Is IE6support required? Yes No Development time x2 QA time x2 Box model works different in IE6 x3 And there’s all the bugs that will never be fixed x4
  • 125.
  • 126. FlatteningBrowsers diferences •Weapons ofchoice oCSS Hacks oConditionalCSS oModernizr, Polyfills
  • 127. CSS Hacks •Youcanuse hacksifyouhaveto: .c {border-radius: 10px; } .c{_border: 1px solid black; } <= IE6
  • 128. CSS Hacks •Youcanuse hacksifyouhaveto: .c {border-radius: 10px; } .c{_border: 1px solid black; } .c{*border: 1px solid black; } <= IE7
  • 129. CSS Hacks •Youcanuse hacksifyouhaveto: .c {border-radius: 10px; } .c{_border: 1px solid black; } .c{*border: 1px solidblack; } .c{border: 1px solid black9; } <= IE8
  • 130. CSS Hacks •Youcanuse hacksifyouhaveto: .c {border-radius: 10px; } .c{_border: 1px solid black; } .c{*border: 1px solidblack; } .c{border: 1px solidblack9; } .c{border: 1px solidblack0/; } IE8 & IE9
  • 131. CSS Hacks •Youcanuse hacksifyouhaveto: .c {border-radius: 10px; } .c{_border: 1px solid black; } .c{*border: 1px solidblack; } .c{border: 1px solidblack9; } .c{border: 1px solidblack0/; } .c{border: 1px solid black90; } IE9
  • 132. Conditional CSS •You can use classes if you want to <!--[if IE 7]><scripttype="text/javascript"> osjs('html').addClass('ie7'); </script><![endif]--> .c {border-radius: 10px; } .ie7 .c{border: 1px solid black; }
  • 133. Modernizr •Isn’t really what you think it is, sorry. •Enables use of HTML5 tags in IE (but we don’t need that) •Provides feature detection mechanisms
  • 134. Modernizr •Differentpackages •Differentoutputs .c {border-radius: 10px; } .ie7 .c{border: 1px solid black; }
  • 135. Polyfills Scripts that enhance your browser’s capabilities... But they always come at a cost! CSS3 PIE (http://css3pie.com/) Other resources (https://github.com/Modernizr/Modernizr/wiki/ HTML5-Cross-Browser-Polyfills)
  • 136. Polyfills •Conditionsto use: oSmallchanges oFewelements •ExampleofusageinOS: PIE
  • 137. Agenda •CSS b-a-ba •Bug? Inspect it! •Bring to OSDE •Box Model •Box placement •Vertical Alignment •Browser compatibility •CSS BestPratices •Grids & Media queries
  • 138. Exercise 8 •Troubleshoot the problem using the inspector •Final page should like this:
  • 141. CSS contaminatesBrowser defaults -CSS Resets •Normalize.css ohttp://necolas.github.com/normalize.css/ •Reset.css ohttp://meyerweb.com/eric/tools/css/reset/
  • 142. CSS contaminates Building a widget library? .my-widgets-nav{/* ... */} .my-widgets-picker{/* ... */} .my-widgets-note{/* ... */} Prefix all things!
  • 143. CSS best practices •Organize yourcode: oHTML Tags oWidgets oRichWidgets oValidations oLayout oHeader & Footer oMenu oOtherClasses •Use usefulnamingconventions •Reduce& Reuse
  • 144. Danger of Componentization <head> <link href="_Basic.css?6430" type="text/css" rel="stylesheet"> <link href="/RichWidgets/Blocks/RichWidgets/RichWidgets/Icon.css?8" type="text/css" rel="stylesheet"> <link href="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Content/PanelById.css?6430" type="text/css" rel="stylesheet"> <link href="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Common/LoginInfo.css?6430" type="text/css" rel="stylesheet"> <link href="/RichWidgets/Blocks/RichWidgets/jQueryUI/jQueryUIInternal.css?8" type="text/css" rel="stylesheet"> <link href="/RichWidgets/Blocks/RichWidgets/RichWidgets/Feedback_Message.css?8" type="text/css" rel="stylesheet"> <link href="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Private/Feedback_AjaxWait.css?6430" type="text/css" rel="stylesheet"> <link href="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Patient/ToggleDetails.css?6430" type="text/css" rel="stylesheet"> <link href="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Content/PageHead.css?6430" type="text/css" rel="stylesheet"> <link href="/RichWidgets/Blocks/RichWidgets/RichWidgets/Input_Calendar.css?8" type="text/css" rel="stylesheet"> <link href="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Content/SectionTitle.css?6430" type="text/css" rel="stylesheet"> <link href="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Content/ExpandArea.css?6430" type="text/css" rel="stylesheet"> <link href="/RichWidgets/Blocks/RichWidgets/RichWidgets/List_SortColumn.css?8" type="text/css" rel="stylesheet"> <link href="/RichWidgets/Blocks/RichWidgets/RichWidgets/List_Counter.css?8" type="text/css" rel="stylesheet"> <link href="/RichWidgets/Blocks/RichWidgets/RichWidgets/List_Navigation.css?8" type="text/css" rel="stylesheet"> <link href="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/ListRecords/LineElement.css?6430" type="text/css" rel="stylesheet"> <link href="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/DetailsBlock/Line.css?6430" type="text/css" rel="stylesheet"> <link href="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/DetailsBlock/Interaction.css?6430" type="text/css" rel="stylesheet"> <link href="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Content/Section.css?6430" type="text/css" rel="stylesheet"> <link href="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Tooltips/PopupMenu.css?6430" type="text/css" rel="stylesheet"> <link href="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Tooltips/Tooltipster_Tooltip.css?6430" type="text/css" rel="stylesheet"> <link href="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Tooltips/Tooltipster_Container.css?6430" type="text/css" rel="stylesheet"> <link href="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Deprecated/PopupWindow.css?6430" type="text/css" rel="stylesheet"> <link href="Theme.SapphireStyleG_dev.css?6430" type="text/css" rel="stylesheet"> <link href="Theme.SapphireStyleG_dev.extra.css?6430" type="text/css" rel="stylesheet"> <script src="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Common/MenuRight.js?6430" type="text/javascript" charset="UTF-8"></script> <script src="/SapphireStyleG_dev/Blocks/RichWidgets/jQueryUI/jQueryUIInternal.en.js?8" type="text/javascript" charset="UTF-8"></script> <script src="/SapphireStyleG_dev/Blocks/RichWidgets/jQueryUI/jQueryComponents.en.js?8" type="text/javascript" charset="UTF-8"></script> <script src="/SapphireStyleG_dev/Blocks/RichWidgets/jQueryUI/jQueryCookie.en.js?8" type="text/javascript" charset="UTF-8"></script> <script src="/SapphireStyleG_dev/Blocks/RichWidgets/jQueryUI/jQueryCurvycorners.en.js?8" type="text/javascript" charset="UTF-8"></script> <script src="/SapphireStyleG_dev/Blocks/RichWidgets/RichWidgets/Feedback_Message.en.js?8" type="text/javascript" charset="UTF-8"></script> <script src="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Private/Feedback_AjaxWait.js?6430" type="text/javascript" charset="UTF-8"></script> <script src="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Layouts/Layout.js?6430" type="text/javascript" charset="UTF-8"></script> <script src="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Patient/ToggleDetails.js?6430" type="text/javascript" charset="UTF-8"></script> <script src="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Patient/PatientDetails.js?6430" type="text/javascript" charset="UTF-8"></script> <script src="/SapphireStyleG_dev/Blocks/RichWidgets/RichWidgets/Input_Calendar.en.js?8" type="text/javascript" charset="UTF-8"></script> <script src="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Content/TabsClient.js?6430" type="text/javascript" charset="UTF-8"></script> <script src="/SapphireStyleG_dev/Blocks/RichWidgets/RichWidgets/List_SortColumn.en.js?8" type="text/javascript" charset="UTF-8"></script> <script src="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Content/PanelById.js?6430" type="text/javascript" charset="UTF-8"></script> <script src="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Tooltips/PopupMenu.js?6430" type="text/javascript" charset="UTF-8"></script> <script src="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Javascript/Tooltipster.js?6430" type="text/javascript" charset="UTF-8"></script> <script src="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Tooltips/Tooltipster_Tooltip.js?6430" type="text/javascript" charset="UTF-8"></script> <script src="/SapphireStyleG_dev/Blocks/SapphireStyleG_dev/Deprecated/PopupWindow.js?6430" type="text/javascript" charset="UTF-8"></script> </head> IE 7/8 only import (css+JS) 30files
  • 145. Agenda •CSS b-a-ba •Bug? Inspect it! •Bring to OSDE •Box Model •Box placement •Vertical Alignment •Browser compatibility •CSS BestPratices •Grids & Media queries
  • 148. Fluid but not entirely
  • 149. Why not entirelly? For more details check this post
  • 150. Media Queries “allows the content rendering to adapt to conditions such as screen resolution“
  • 152. Media queries syntax Learn more @ MDN
  • 153. RWD?!
  • 154. “responsive web design isn’tintended to serve as a replacementfor mobile web sites”
  • 155.
  • 156. Exercise 9 •Duplicate the page Exercise 5 •Rename it Exercise 9 •The exercise is to make this page Responsive •Needs to be responsive to all devices
  • 158. Be Pragmatic •If CSS gets in your way, go the other way oExample: vertically centering •Use CSS as a fast-prototyping tool oIf old browsers get too quirky, print-screen and use images!
  • 161. CSS in your favor(fast prototyping), never against you!
  • 163. References •Compatibilityquickreference •Checkifyoucanuse anelement •MostcommonIE Bugs •Cross-browser CSS •Normalize.css •CSS Reset •W3C CSS& HTMLvalidator •Selectors
  • 164. References •CSS Positioning 101 •CSS Floats •Containing Floats •960 Grid System •Twitter’s Bootstrap •Basic CSS layouts(learn by view-source) •A ton of CSS Snippets(from css-tricks.com) •Modernizrlist of Polyfills
  • 165. References •CSS 3 Modules (MDN) •CSS 3 Demo Studio

Editor's Notes

  1. Welcome to the CSS Worshop This workshop is essentially introdutory, but event if you’ve been using CSS for years, it can still be useful. Most people think that CSS is like a mystical art that nobody truly understands... Sometimes it works, sometimes it doesn’t...
  2. People are usually afraid of CSS and try to understand it as little as possible and hack with it instead of building with it. Nothing good ever comes out of this approach. Browser bugs and incompatibilities don’t help here, but the fact that people don’t even try to read and understand the specifications helps even less.
  3. Typically this is how our css ends up looking like....
  4. The three major pillars for websites and web applications are: HTML CSS JavaScript In this workshop we’ll focus on the CSS.
  5. Cascading Style Sheets or CSS are set up so that you can have many properties all affecting the same element. Some of those properties may conflict with one another. For example, you might set a font color of red on the paragraph tag and then later on set a font color of blue.  There are three different types of style sheets Author Style Sheets User Style Sheets User Agent Style Sheets
  6. Basic CSS rule syntax... Selectors, properties and values
  7. Kinds of selectors: - tag: html tag (h1, div) class id pseudo-class: to add special effects do some selectors attribute: html elements can have specific attributes, not just ID and class
  8. Kinds of selectors: - tag: html tag (h1, div) class id pseudo-class: to add special effects do some selectors attribute: html elements can have specific attributes, not just ID and class
  9. Kinds of selectors: - tag: html tag (h1, div) class id pseudo-class: to add special effects do some selectors attribute: html elements can have specific attributes, not just ID and class
  10. Kinds of selectors: - tag: html tag (h1, div) class id pseudo-class: to add special effects do some selectors attribute: html elements can have specific attributes, not just ID and class
  11. Kinds of selectors: - tag: html tag (h1, div) class id pseudo-class: to add special effects do some selectors attribute: html elements can have specific attributes, not just ID and class
  12. Let’s see some examples of selectors. Consider the html displayed below, which elements will be selected with the selectors above.
  13. Let’s see some examples of selectors. Consider the html displayed below, which elements will be selected with the selectors above.
  14. Let’s see some examples of selectors. Consider the html displayed below, which elements will be selected with the selectors above.
  15. Let’s see some examples of selectors. Consider the html displayed below, which elements will be selected with the selectors above.
  16. Let’s see some examples of selectors. Consider the html displayed below, which elements will be selected with the selectors above.
  17. There are tons of kinds of selectors. Most of them you don’t need on a daily basis though some web designers like to use them all. Most browsers don’t really support all of them.
  18. Selectors can be made out of combinations of selectors. One of the most important is the ability to define multiple selectors for the same style.
  19. Another very important combo is Elements inside another.
  20. Selectors can be made out of combinations of selectors
  21. An example
  22. If an element is matched by many selectors, the resulting style depends on the priority of the selectors: Inline style Id selector Class / attribute selector HTML tags selectors All elements
  23. Specs recommend using #identifiers for styles that appl to a single element but that’s hard in SS because IDs are generated dynamically.
  24. The order of definition in the CSS file is another important thing to have in consideration. The last redefinition is te one how “wons”, overriding the previous definitions and eventually adding new ones.
  25. Important note, how imports work: Link to css added with function HTTPRequestHandler.AddStyleTag webblock CSS Theme CSS Page CSS Inline import CSS
  26. Overrides: border, font-style, color In the end, 5 properties are merged: 2 directly applied and 1 inherited Every element has some style (even if user-agent provided) Beware of collapsed properties (eg: border)
  27. There’s a ton of them. They serve several aspects of a design. Everyday new properties start getting support from browser vendors.
  28. Probably there’s already a property for whatever you’re thinking of doing. W3C and Mozilla are good resources for finding out about properties
  29. Clone eSpace CSSShopExercises
  30. Clone eSpace CSSShopExercises
  31. Clone eSpace CSSShopExercises
  32. Now we’re going to see how can we tackle CSS problems faster Changing faster means faster improvements and better ideas. If the feedback is instantaneous, your productivity will be unmatched.
  33. OutSystems allows 1-click-publish but it’s still nothing like instant feedback. You change, publish, wait, refresh, refresh again, get back... What were you editing?
  34. We can use firebug for instant feedback. You can sit down with a stakeholder for your project or with your designer, and make changes in place. Some example of what could be done: border-radius: 10px 10px 10px 10px; border: 1px solid #00C812; color: white; cursor: pointer; font-size: large; padding: 10px 20px; background: -webkit-linear-gradient(top, #9DD53A 0%, #A1D54F 50%, #7CBC0A 100%) background: -webkit-linear-gradient(top, rgba(248,80,50,1) 0%,rgba(241,111,92,1) 50%,rgba(246,41,12,1) 51%,rgba(240,47,23,1) 71%,rgba(231,56,39,1) 100%);
  35. We can use firebug for instant feedback. You can sit down with a stakeholder for your project or with your designer, and make changes in place. Some example of what could be done: border-radius: 10px 10px 10px 10px; border: 1px solid #00C812; color: white; cursor: pointer; font-size: large; padding: 10px 20px; background: -webkit-linear-gradient(top, #9DD53A 0%, #A1D54F 50%, #7CBC0A 100%)
  36. SS doesn’t allow making use of some fancy elements. But do we need such elements?
  37. We can use containers for everything and differentiate the original element tag with classes
  38. We can use containers for everything and differentiate the original element tag with classes
  39. We can use containers for everything and differentiate the original element tag with classes
  40. Most of us have a lot of trouble when the time comes to layout stuff in the screen using CSS. How does it work? What guidelines can we use to help us?
  41. We should recognize all elements rendered by a browser as boxes. All elements means...
  42. Paragraphs live in boxes
  43. Bullets live in boxes
  44. Some elements aren’t really boxes... They’re inline ... But they can be inline boxes.
  45. Rule of thumb... Everything is a box.
  46. Another thing you should learn about boxes is that boxes have dimensions
  47. Inner width and height
  48. Border widths
  49. Padding (an internal margin)
  50. Margin, the external margin Do you actually know a very useful difference between margin and padding? Margins, if the element isn’t inline, overlap!
  51. You can check those dimensions in your favorite web debugging tool... Search for Layout and see
  52. You’ll often want to play with dimensions... Using borders to give elements some relevance, using padding to let their contents breathe.
  53. And you’ll have to remember that most times dimensions don’t work as you’re expecting The box on the left has 200px height The box on the right has style=“height:200px;”. But it’s true taller. Why?
  54. Height is the inner height, which differs from the visible height. Remember to add padding and border width. This is called the W3C box model.
  55. In this case, 150px of height gives us a visible height of 200px.
  56. Sometimes border and padding do make a lot of difference.
  57. And you’ll have to remember that most times dimensions don’t work as you’re expecting The box on the left has 200px height The box on the right has style=“height:200px;”. But it’s true taller. Why?
  58. So what have we seen until here? - We know about CSS rules We can use firebug for instant feedback We know that browsers behave differently We know everything is a box. How do we layout those boxes?
  59. Let’s see lifetime And let’s remember that everything is a box Header is full of boxes, etc.
  60. Boxes are layed out according to gravity, which means they go up and fill all the horizontal space they can
  61. Sometimes we want to have items side by side
  62. So we can’t let the boxes fill the whole horizontal space
  63. We have to allow them to float By floating, they get cornered We have to apply a clear rule to escape the floating
  64. A common technique known as clearfix is to have an invisible clearer.
  65. The reason why floats are kind of bad is because they live in their own flow If you put a floated element inside a non-floated element, the outside element will act as if the inside element wasn’t even there. Yuck!
  66. Inline-blocks are way more intuitive. If you can (if you don’t need to support IE6), use them. You can thank me later.
  67. See lifetime? No IE6 so we have blocks (lines) and inline-blocks (columns). We didn’t use a tablerecords because we didn’t know how many columns (environments) we would have So we have a listrecords with the line-blocks, and inside it a list-records with the inline-block cells. Who needs tables?
  68. See lifetime? No IE6 so we have blocks (lines) and inline-blocks (columns). We didn’t use a tablerecords because we didn’t know how many columns (environments) we would have So we have a listrecords with the line-blocks, and inside it a list-records with the inline-block cells. Who needs tables?
  69. Floats and inline blocks flow in a liquid layout: they adapt to their container. What happens when we resize that container?
  70. Now that you know about how to layout the boxes Try emulating this layout
  71. Boxes are everywhere... If you get used to seeing them, designing with CSS will become way much easier Another thing that you can recognize is that most pages flow in a grid with rows and columns
  72. Boxes are everywhere... If you get used to seeing them, designing with CSS will become way much easier Another thing that you can recognize is that most pages flow in a grid with rows and columns
  73. Boxes are everywhere... If you get used to seeing them, designing with CSS will become way much easier Another thing that you can recognize is that most pages flow in a grid with rows and columns
  74. Sometimes laying out the boxes using the document flow isn’t enough. Sometimes we just want our boxes to fly.
  75. We can relatively escape the document gravity by using relative positioning. The base coordinates for relative positioning have their origin where the element should be The element’s space is kept, so if we want it to be ignored, we can specify a negative margin of it’s own size. Negative margins can be used to make your elements take less space and even take no space at all.
  76. Another kind of positioning is the absolute positioning. In absolute positioning the coordinates are set in the document (more on that later) and the elements are actually removed from the document flow; their space is removed. You can also use right and bottom coordinates instead of left and top Absolute positioning sets the coordinates to the first non-static element.
  77. Firebug the links to be a right menu.
  78. Firebug the buttons to invert their order
  79. We’ve put some gradients and round corners, etc. Those CSS properties work only in the so called modern browsers. What happens when we have to support older browsers?
  80. This doesn’t mean you can forget about older browsers... Browser compatibility means you have to support every browser, be it through graceful degradation or other methods.
  81. What browsers will you support in the next 10 years?
  82. Graceful degradationi is the art of letting go. Are the round corners really that important or could the % of people using IE7 live without them?
  83. As browsers get older, their share dimminuishes, so you have to manage the time you spend making things pixel-perfect-the-same
  84. As browsers get older, their share dimminuishes, so you have to manage the time you spend making things pixel-perfect-the-same
  85. Check your users’ browser share and don’t forget to check on IE’s versions. Supporting IE is different from supporting IE6…
  86. Check your users’ browser share and don’t forget to check on IE’s versions. Supporting IE is different from supporting IE6…
  87. In IE& the “shoes” and the “hat” actually count as visual height.
  88. Join the movement!
  89. There are some tools at your disposal to help with browser compatibility
  90. You can use conditional CSS by using hacks (eg: star-property is only recognized in IE7, underscore in IE6)
  91. You can use conditional CSS by using hacks (eg: star-property is only recognized in IE7, underscore in IE6)
  92. You can use conditional CSS by using hacks (eg: star-property is only recognized in IE7, underscore in IE6)
  93. You can use conditional CSS by using hacks (eg: star-property is only recognized in IE7, underscore in IE6)
  94. You can use conditional CSS by using hacks (eg: star-property is only recognized in IE7, underscore in IE6)
  95. You can use more readable approaches. If you were using modernizr, you could use .no-round-corners instead of .ie7.
  96. Modernizr doesn’t make your browser more moddern It makes it recognize some elements and provides feature detection so you can verify if your browser supports round corners instead of checking if the browser is IE<9.
  97. Polyfills emulate new functionality on browsers that don’t support it. Usually this happens by the means of scripts that emulate behaviors and running features that were supposed to be native using scripts comes at a cost. Sometimes pages hang, sometimes script errors occur, sometimes your layout gets all screwed. Be careful and test these alternatives a lot.
  98. Firebug the links to be a right menu.
  99. What was wrong? CSS contaminates
  100. Normalize: sets the same style across browsers preserving some defaults Reset: completely overrides the browsers css in order to flatten them up
  101. When you’re creating widgets, try to get your style self-contained. A good practice is to use a common prefix to all your styles and not to use selectors that are way too generic.
  102. http://www.outsystems.com/forums/discussion/12100/how-to-build-a-fluid-grid/
  103. Media Queries is a CSS3 module allowing content rendering to adapt to conditions such as screen resolution (e.g. smartphone vs. high definition screen). It became a W3C recommended standard in June 2012.[1] and is a cornerstone technology of Responsive web design.
  104. As with all good things, this presentation must come to an end
  105. Always be pragmatic
  106. There’s no magic. If you don’t understand a behavior, take the time to read the standard, it will make you a lot faster in the future.
  107. Instant prototyping is king
  108. Questions and requests?