View Single Post
Old 12-23-2011, 08:51 AM   #1
ElMiko
Evangelist
ElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileReadElMiko has read every ebook posted at MobileRead
 
ElMiko's Avatar
 
Posts: 455
Karma: 65460
Join Date: Jun 2011
Device: Kindle
Question: Find/Replace in css stylesheet

I'm trying to replace all margin values with 0. Is there any way to do this? I keep getting screwed up by the fact that the strings don't end consistently: sometimes the end in ";" (easy enough to search for and replace), but sometimes the string ends in "[\s]" or "}". One solution I considered would be to replace all numbers following the colon ("margin([^:]*): [0-9]+") with a zero ("margin\1: 0"), but the search gets hung up by the decimal point.

What am I doing wrong... besides everything?

Spoiler:

.calibre {
display: block;
font-size: 1em;
line-height: 1.2;
margin-bottom: 0;
margin-left: 5pt;
margin-right: 5pt;
margin-top: 0;
padding-left: 0;
padding-right: 0
}
.calibre1 {
display: block;
text-align: center
}
.calibre2 {
display: block;
font-size: 1.5em;
font-weight: bold;
line-height: 1.2;
margin-bottom: 0;
margin-left: 0;
margin-right: 0;
margin-top: 0.67em
}
.calibre3 {
display: block;
font-size: 1.375em;
font-weight: bold;
line-height: 1.2;
margin-bottom: 0;
margin-left: 0;
margin-right: 0;
margin-top: 0.83em
}
.calibre4 {
border: 1px inset;
color: gray;
display: block;
height: 2px;
margin-bottom: 0;
margin-left: auto;
margin-right: auto;
margin-top: 0.5em
}
.calibre5 {
display: block;
margin-bottom: 0;
margin-left: 0;
margin-right: 0;
margin-top: 1em
}
.calibre6 {
font-style: italic
}
.calibre7 {
display: block;
margin-bottom: 0;
margin-left: 0;
margin-right: 0;
margin-top: 1em;
text-align: right
}

Last edited by ElMiko; 12-23-2011 at 08:54 AM.
ElMiko is offline   Reply With Quote