4
<sytle>
.typing{
display: inline-block;
width: 100%;
white-space:nowrap;
overflow:hidden;
-webkit-animation: type 2s steps(50, end) alternate;
animation: type 2s steps(50, end) alternate;
-webkit-animation-iteration-count: infinite; /* Chrome, Safari, Opera */
animation-iteration-count: infinite;
}
@keyframes type{
from { width: 0; }
}
@-webkit-keyframes type{
from { width: 0;  }
}
<style>
<div id="top" class="header">
<div class="text-center">
    <h1 class="typing"  >
<b>Find anything for your Business Instantly</b>
<b>Source >> Supply >> Grow your Business Online</b>
<b>Create your Home &amp; Global website online</b>
    </h1>        
</div>
</div>

i have 3 bold tags which is in h1 tag, here it should display in one line, As one after another bold tag as shown in the link see this link : http://www.indiamart.com/

Please can anyone help me.

1
  • I think you'l need a letter selector, which isn't available in CSS. You should probably try a js solution. Commented Apr 2, 2016 at 6:38

2 Answers 2

1

Original code by Lea Verou

@-webkit-keyframes typing {
    from { width: 0 }
    to { width:16.3em }
}

@-moz-keyframes typing {
    from { width: 0 }
    to { width:16.3em }
}

@-webkit-keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: black }
}

@-moz-keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: black }
}

body { font-family: Consolas, monospace; }

h1 { 
    font-size:150%;
    width:16.3em;
    white-space:nowrap;
    overflow:hidden;
    border-right: .1em solid black;
    
    -webkit-animation: typing 17s steps(30, end), /* # of steps = # of characters */
                        blink-caret 1s step-end infinite;
    -moz-animation: typing 17s steps(30, end), /* # of steps = # of characters */
                        blink-caret 1s step-end infinite;
}
<h1>This is a css typewriter</h1>

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you for your help, but here i need three b tags and it should override one another. And i already tried this
I don't think it is a typewriter effect in your link. This is just a div with overflow:hidden and a with animation on it, i guess.
0

Use Keyframes to add typing animation to html elements.

.text { 
	font: bold 200% Consolas;
	border-right: .1em solid black;
	width: 28ch;
	white-space: nowrap;
	overflow: hidden;
	margin: 30px;
	-webkit-animation: type 4s steps(28, end),
	blink-caret .4s step-end infinite alternate;
}
@-webkit-keyframes type { from { width: 0; } }
@-webkit-keyframes blink-caret { 50% { border-color: transparent; } }
<p class="text">Stay Hungry ! Stay Foolish !</p>

See Demo here :- http://codingflag.in/mysketch.php?sketch=6

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.