From: Brad C. <yo...@br...> - 2005-06-10 15:32:44
|
I think that's about as good as you're going to find right now as we don't do any parsing of the CSS. You should also note that you're only looking at the exact style attribute of the element, not any styles that may have be inherited through a style tag and/or the class attribute. Brad C --- Daniel Hofstetter <dan...@gm...> wrote: > Hi, > > is there another (more elegant) way to access style attributes as the > one I have chosen? > > StyledElement element = (StyledElement)nextPage.getHtmlElementById("error"); > String s = element.getStyleAttribute(); > > int start = s.indexOf("display:") + "display:".length(); > String attributValue = s.substring(start, s.indexOf(";", start)).trim(); > > Thanks, > Daniel |