Drop Cap

Posted on 2014-03-10
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?
Question by:Barbara69
  • 3
  • 3
LVL 58

Expert Comment

ID: 39917944
You would have to write an element (div etc) and style the element inline

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

Author Comment

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.
LVL 58

Expert Comment

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.


Author Comment

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?

Author Comment

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.
LVL 58

Accepted Solution

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

Open in new window


Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Json Schema 8 32
what is the best Integrated development environment 2 20
Responsive Font Size 6 27
..ignore the Question 1 7
Find out what you should include to make the best professional email signature for your organization.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

856 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