xml to pdf c# itextsharp : How to add bookmarks to a pdf control Library platform web page .net winforms web browser Build%20Your%20Own%20Web%20Site%20The%20Right%20Way%20Using%20HTML%20&%20CSS%203rd%20Ed15-part771

Specifically Speaking
Thosewith aneagle eye willhavenoticed thatnot allthe .fun stylesin the pre-
vious exampleareactuallyapplied tothequotation. Thefont-familyand
letter-spacingdeclarations take effect,but thecolorchange doesnot! This
canbeexplainedwith the conceptofspecificity.
Specificitysimplymeansthatthe rulethat’s themostspecificis the onethat is
applied.Determiningwhich ruleisthe mostspecificisa bitcomplex,butunder-
standable. Inourstylesheet, thespecificityiseasytodetermine:the .fun ruleis
applied tothe blockquoteelement, and properties areinherited bythep ele-
ments,butpropertyvaluesareonlyinheritedintheabsenceofanyotherdeclara-
tion.Wehaveanothercolordeclarationinourprojectsite—theonethatwecreated
atthe startofthe chapterthatstates that allparagraphs shouldbenavy-colored:
p {
color: navy;
}
Therule withtheelementselectorp has agreaterspecificityforthe pelements,
becausetheselectorspecificallytargets pelements,whereas the .fun ruledoes
not.Imagine if,however, weaddedanotherrulelikethis:
.fun p {
color: green;
}
Theeffectwouldbethis:allparagraphtextisnavy,exceptfortheparagraphsinside
elementswith the class fun,whichwould begreen. This isbecausethe .fun
pselectoris morespecificforthoseparagraphs. Notethat, unlike theconflicting
rulesweencounteredinthesectioncalled“WhichRuleWins?”,thisbattlebetween
stylerules has norelation tothe orderin which theyappearin thestylesheet.
Specificitycan beconfusing, sodon’tlosetoomuch sleep overit; fornow, it’s
enoughjusttobeawareoftheconcept,asthismaybethereasonwhyoneofyour
stylesfails totakeeffectwhenyou’reconvinced itshould. Specificityiscovered
ingreatdepthin theSitePointCSSReferenceifyou’d liketoexploreit further.
10
10
http://reference.sitepoint.com/css/specificity/
Build Your Own Website The Right Way Using HTML & CSS
114
How to add bookmarks to a pdf - add, remove, update PDF bookmarks in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
Empower Your C# Project with Rapid PDF Internal Navigation Via Bookmark and Outline
bookmark page in pdf; bookmark pdf documents
How to add bookmarks to a pdf - VB.NET PDF bookmark library: add, remove, update PDF bookmarks in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
Empower Your VB.NET Project with Rapid PDF Internal Navigation Via Bookmark and Outline
adding bookmarks to pdf; how to add bookmarks to a pdf
Styling Partial Text Using 
span
So,aclasscanbeappliedinmanydifferentplaces—perhapsto aspecificparagraph,
ortoablockofseveralparagraphscontainedina
blockquote
,ortoa
div
thatholds
many forms ofcontent.But what wouldyou do ifyouwanted to apply thestyle to
averysmallsectionoftext—maybejustacoupleofwords,orevenacoupleofletters,
within aparagraph?For this,once again, youcan usethe
span
element.
Earlierinthischapter,Ishowedhowyoucouldusethe
span
elementinconjunction
withinlinestylestopickoutandstylespecificwordswithinaparagraph.Theexact
sametechnique can be used with classes: wesimply placean opening
<span>
tag
atthepoint atwhich wewantthestylingto begin, and theclosing
</span>
tag
wherewewant itto end.Theadvantage ofthis techniqueover the inline style
demonstrated earlier is thatthestyle is defined in asinglelocation,so you could
potentially add the
fun
classto many differentelementson many different pages
with aminimumofhassle.When youdecidethatyouwantto haveadifferentkind
offun(so to speak),you need only changeyour stylesheet(
style1.css
)for thatnew
styleto bereflectedacross your site:
<p><span class="fun">Bubble Under</span> is a group of diving
enthusiasts based in the south-west UK who meet up for diving
trips in the summer months when the weather is good and the
bacon rolls are flowing. We arrange weekends away as small
groups to cut the costs of accommodation and travel and to
ensure that everyone gets a trustworthy dive buddy.</p>
Try applyingthespan elementas suggestedin theaboveHTMLcodetoyour About
Uspage. Ifyou savethe changesand check theminyour browser(remember to hit
Reload
), your pageshould look liketheoneshown in Figure3.16.
115
Adding Some Style
How to C#: Basic SDK Concept of XDoc.PDF for .NET
Document Protect. You may add PDF document protection functionality into your C# program. OutLines. This class describes bookmarks in a PDF document.
how to create bookmarks in pdf file; copy bookmarks from one pdf to another
VB.NET PDF: Basic SDK Concept of XDoc.PDF
Document Protect. You may add PDF document protection functionality into your VB.NET program. OutLines. This class describes bookmarks in a PDF document.
add bookmark pdf; adding bookmarks in pdf
Figure 3.16. Applying the 
fun
class to two specific words
Avoid Throwing (Needless) 
span
s into the Works
Thespanelement ismostlyusedwith aclass attribute.There are veryfewoc-
casions when you’llwant toapplya span elementtoyourHTML on its own
withouta class oridof some kind.
Beforeyouapplyaspan toanygivenelement on yourwebpage, take amoment
tothinkaboutwhetherthere’sanotherelementthat’sbettersuitedtothetask.For
example, it’sadvisable nottodothis:
<p>Do it <span class="shouty">now</span>!</p>
Amore appropriatechoicewould betousethe strongelement:
<p>Do it <strong>now</strong>!</p>
Thinkofthemeaningofwhatyou’rewriting,andaimfortheHTMLelementthat
bestsuitsthepurpose.Otherexamplesmight be em, cite,andblockquote.
Summary
It’s been another busy chapter,butmy,howoursite’sblossoming!A chapter or two
agowehadn’tevenbuiltawebpage,butnowweknowhow toapplya(virtual)lick
Build Your Own Website The Right Way Using HTML & CSS
116
C# PDF File Compress Library: Compress reduce PDF size in C#.net
Bookmarks. Comments, forms and multimedia. Flatten visible layers. C#.NET DLLs: Compress PDF Document. Add necessary references: RasterEdge.Imaging.Basic.dll.
bookmarks pdf; add bookmarks to pdf
VB.NET PDF File Compress Library: Compress reduce PDF size in vb.
document file. Remove bookmarks, annotations, watermark, page labels and article threads from PDF while compressing. Also a preview
add bookmarks to pdf online; create bookmarks in pdf
ofpaint to any typeofHTML elementon apage, aspecificsectionofaweb page
dependingon its
id
,or arbitrary portionsofapage—sometimesin severaldifferent
places—usingclass selectors.
Thewebsiteisstartingtolook alittlemorecolorful,butthelayoutisstillfairlybasic.
In thenextchapter,we’lllook athow it’s possibleto change thelayoutofelements
on apage—their position,shape,size,and more—usingCSS. Stylingtext? Been
there,donethat.Let’s moveto the nextlevel!
117
Adding Some Style
VB.NET PDF File Split Library: Split, seperate PDF into multiple
Add necessary references: The following VB.NET codes explain how to split a PDF file into multiple ones by PDF bookmarks or outlines.
bookmarks pdf reader; add bookmark to pdf reader
C# PDF File Split Library: Split, seperate PDF into multiple files
Add necessary references: RasterEdge.Imaging.Basic.dll. The following C# codes explain how to split a PDF file into multiple ones by PDF bookmarks or outlines.
convert word to pdf with bookmarks; add bookmarks pdf
.NET PDF SDK - Description of All PDF Processing Control Feastures
Full page navigation, zooming & rotation; Outlines, bookmarks, & thumbnail display; PDF Text Write & Extract. Insert and add text to any page of PDF document with
create bookmark in pdf automatically; bookmarks pdf documents
XDoc.Word for .NET, Advanced .NET Word Processing Features
page navigation, zooming & rotation; Outlines, bookmarks, & thumbnail Convert Word to PDF; Convert Word to HTML5; Convert Add and insert a blank page or multiple
add bookmarks to pdf preview; create bookmarks pdf
Chapter
4
Shaping Up Using CSS
For many years,web developersregarded CSS asa toolthatcould beused to style
textonweb pages, andadd a splashofcolor hereand there,butlittle more.And
foralongtime,thatwasallyoucouldrealisticallyuseitfor,becausebrowsersupport
for CSS was below par.Thankfully, progresshas beenmade!
You’venowreachedapointatwhichmanybuddingwebdesignersstopexperiment-
ingwith CSS. Not you!In thischapter,we’regoingto delvea littlefurther into the
capabilities ofCSS aswe useitto:
alter the shape andsizeofspecific areasofcontent
changebackgrounds and border styles
position items anywhereon the web page
Let’sbegin,then, by seeing how we can useCSS to changetheshapeand size of
items on aweb page. However,before wecan understand thistechnique,weneed
to grasp thedifferencebetween block-levelelements and inlineelements.
Block-level Elements versus Inline Elements
Any given web pagecomprises two basictypes ofelements:block-level elements
and inlineelements.Itis important to appreciate thedifferences betweenthese
elementtypes,particularly whereCSS isconcerned.
The Basic Rules of Block-level and Inline Elements
Whenexplainingthedifferencebetweenthesetwotypesofelements,Iliketouse
ananalogyofstacking/nestingboxes.Youknowthekindyouusuallybuyinaset
of five, wheretheyarepacked oneinside theother. You can take themout, stack
themoneon topoftheotherlikeatower, orputthemsidebyside—butyoucan’t
placethebiggestboxinsidethesmallest box;thelaws of physics still apply!
Block-levelelements are like these boxes. Theycan containotherblock-level
elements,possiblymanylevelsdeep,buttherearerulesaboutwhatkindofblock-
levelelements can bekept insidethecontaining-levelelements. Justasa bigbox
won’tgointoasmallbox, wecan’tputadivelement insideap (paragraph) ele-
ment;We can, however, put apinsidea div. You’llcometoknowtherules over
time, and thereareways you canchecktoseeif you haveitright.
That’sblock-levelelements.Sowhatareinlineelements?Thinkoftheseas the
trinkets andwhatnotthatweusuallykeepinsidesuchboxes.Theycanonlyever
goinsidetheseboxes,orfitdownthegapsbetweenthenestedboxes, ortaken out
and leftscattered nexttothe boxes. Buttheycanneverwrap aroundtheselarge
boxes—it’simpossible.So,translatingtheanalogyback,aninlineelementcannot
be wrapped arounda block-level element.
Tosummarize:
Ablock-levelelementcancontainotherblock-levelelements,aswellasinline
elements.
An inline elementcan onlycontainotherinlineelements.
Block-level Elements
As Ijustexplained, ablock-levelelementis any elementthatcan contain other
elements (block-leveland inline).To identify ablock-level element, look for any
elementthat’s:
Build Your Own Website The Right Way Using HTML & CSS
120
normally displayedon its ownline,or across multiplelines(other elements
probablyappearaboveorbelowit,butnotoneitherside—notbydefault,anyway)
being used asa container for oneor more elements
Herearea few examples ofcommon block-levelelements:
h1
,
h2
,
h3
,and so on, through to
h6
p
div
blockquote
ul
and
ol
form
1
Whenyou createa paragraph oftext, there’sno need to tellthebrowser to add a
carriagereturn, startanew line,and add another carriage return atthe endofthe
paragraph;theopening
<p>
and closing
</p>
tagsdo thatfor you.Consider thetext
thatappears on our site’s AboutUspage:
chapter4/website_files/01_block_level_elements/about.html
(excerpt)
<h2>About Us</h2>
<p><span class="fun">Bubble Under</span> is a group of diving
enthusiasts based in the south-west UK who meet up for diving
trips in the summer months when the weather is good and the
bacon rolls are flowing. We arrange weekends away as small
groups to cut the costs of accommodation and travel and to
ensure that everyone gets a trustworthy dive buddy.</p>
<p>Although we're based in the south-west, we don't stay on our
own turf: past diving weekends away have included trips up to
Scapa Flow in Scotland and to Malta's numerous wreck
sites.</p>
<p>When we're not diving, we often meet up in a local pub to
talk about our recent adventures (<em>any</em> excuse,
eh?).</p>
<p>Or as our man Bob Dobalina would put it:</p>
<blockquote class="fun">
<p>"Happiness is a dip in the ocean followed by a pint or two
of Old Speckled Hen. You can quote me on that!"</p>
</blockquote>
1
Formswillbe discussedindetailinChapter7.
121
Shaping Up Using CSS
Theheading(
h2
)and threeparagraphsareallblock-levelelements.Theyrepresent
blocksofcontent,whereclearly definedbreaksappearaboveandbeloweachblock.
This is clear inFigure4.1,where the block-levelelementsare outlined.
Figure 4.1. Blocks of content revealing HTML block-level elements
Inline Elements
Aneasy way toidentify an inlineelementisto remember thatitsitsinsideanother
element. As weestablished in my stacking/nestingboxesanalogy,we can have a
box ofold photos, or abox containingjustonephoto,butwecan’t havea photo
fullofboxes—it’s physically impossible!Similarly, it’s againstthe specifications
to use an inlineelementto contain ablock-levelelement. A good example ofan
inlineelementis
span
(coveredinChapter3),usedtogroupwordstogether inorder
to apply astyle:
chapter4/website_files/01_block_level_elements/about.html
(excerpt)
<p><span class="fun">Bubble Under</span> is a group of diving
enthusiasts based in the south-west UK who meet up for diving
trips in the summer months when the weather is good and the
bacon rolls are flowing. We arrange weekends away as small
groups to cut the costs of accommodation and travel and to
ensure that everyone gets a trustworthy dive buddy.</p>
Build Your Own Website The Right Way Using HTML & CSS
122
Other examplesofinlineelements include:
em
strong
cite
a
Looking atthe examplemarkup above,any oneofthoseinlineelementscould be
applied to thewords “BubbleUnder”:
<p><em>Bubble Under</em> is a group of diving enthusiasts…</p>
<p><strong>Bubble Under</strong> is a group of diving
enthusiasts…</p>
<p><cite>Bubble Under</cite> is a group of diving enthusiasts…</p>
<p><a href="http://www.bubbleunder.com/">Bubble Under</a> is a
group of diving enthusiasts…</p>
Infact,even theimageelement,
img
,isinline,although weuseitalittledifferently
fromtheelements mentioned above.Instead,
img
doesn’t provide any information
to thebrowser abouthow textshouldbetreated; an imageissimply an image.
Inline Begets Inline
It’s perfectly okay to nestone inline elementinside another.Here’s an example of
an inlineelement thatcontains another inlineelement:
<p><span class="fun"><a href="http://www.bubbleunder.com/">Bubble
Under</a></span> is a group of diving enthusiasts based in
the south-west UK who meet up for diving trips in the summer
months when the weather is good and the bacon rolls are
flowing. We arrange weekends away as small groups to cut the
costs of accommodation and travel and to ensure that everyone
gets a trustworthy dive buddy.</p>
Actually,takingtheindividualexamplesjustshown,eventhemarkupbelowwould
constituteacceptableand valid HTML (althoughitmay seem likeoverkill):
<p><strong><em><cite><a href="http://www.bubbleunder.com/">Bubble
Under</a></cite></em></strong> is a group of diving
enthusiasts…</p>
123
Shaping Up Using CSS
Documents you may be interested
Documents you may be interested