In this post I would like to replace all <embed> HTML tags in a HTML file with a <strong> tag.
# sed -e 's/<embed[^>]*>/<strong>/g' filename.html > newfile.html
And if you would like to remove the <embed> tag altogether
# sed -e 's/<embed[^>]*>//g' filename.html > newfile.html
To remove all HTML tags in a file
# sed -e 's/<[^>]*>//g' filename.html > newfile.html
The result file newfile.html is now without any < HTML tags >.
Tags: html, regexp, replace, sed
Posted by Hans-Henry Jakobsen
I’ve gotten tired of my Flashpresentation movies not being valid HTML. After some research and a tip from a friend of mine I found this solution to the problem.
<object type="application/x-shockwave-flash" data="images/banner.swf" width="288" height="128"> <param name="movie" value="images/banner.swf" /> <img src="banner.gif" width="288" height="128" alt="banner" /> </object>
It works great and shows a image file if Flash support isn’t available.
Source: http://www.ambience.sk/flash-valid.htm
Posted by Hans-Henry Jakobsen
I wanted to make a whole year calendar and found pcal, a command line tool.
pcal -F 1 -E -B -O -p -w -o 2008.ps 2008
It is also possible to generate a calendar as HTML table using the -H switch.
This program can be installed in Debian/Ubuntu
apt-get install pcal
Posted by Hans-Henry Jakobsen
Premailer is a script accessible from the web that turns external CSS webpage into inline, improving the rendering of HTML e-mail.
This makes it possible to make a webpage and then run it througt this script to make a HTML e-mail.
Posted by Hans-Henry Jakobsen
It can sometimes be useful to have some text be aligned to the left and some text be aligned to the right on the same line, eg in a footer.
Here is how this can be done in HTML:
<div id="footer"> <p class="leftalign">Text on the left.</p> <p class="rightalign">Text on the right.</p> </div>
If you were to then give your CSS classes leftalign and rightalign values of text-align: left; and text-align: right; respectively, you would get close to your desired result, but your right-aligned text would be bumped down one line because of the new paragraph. Instead, just float your paragraphs:
.leftalign { float: left; } .rightalign { float: right; }
Then just remember to clear your float:
<div style="clear: both;"></div>
Posted by Hans-Henry Jakobsen