Solved

Drop Cap

Posted on 2014-03-10
6
160 Views
Last Modified: 2014-03-21
I understand how to use drop cap within <p>, but how do you use drop cap when using document.writeln?
0
Comment
Question by:Barbara69
  • 3
  • 3
6 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39917944
You would have to write an element (div etc) and style the element inline
e,g,

document.writeln('<div style="add styles here">test</div>')
0
 

Author Comment

by:Barbara69
ID: 39918258
I'm not sure I understand. I tried what you suggested and nothing happend. I have document.writeln("Hi, my name is Barbara....") and I want to use drop cap on the H in Hi.
0
 
LVL 58

Expert Comment

by:Gary
ID: 39918271
Like this

document.writeln('<div style="float:left;font-size: 75px; line-height: 60px; ">H</div>i, my name is Barbara....')

Open in new window

0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:Barbara69
ID: 39928403
Wouldn't it be better to put the style in your suggestion in a css and do a <div class=""> or <p class=""> within the writeln?
0
 

Author Comment

by:Barbara69
ID: 39928408
I pressed enter before I was finished. I created a style, put it in my css file and put <p class=""> within the writeln.
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39929553
Which ever way works best for you, I was just giving an all in one solution.
<style>
div {float:left;font-size: 75px; line-height: 60px;}
</style>
<script>
document.writeln('<div>H</div>i, my name is Barbara....')
</script>

Open in new window

0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now