对象标签内的段落

时间:2015-10-28 18:10:29

标签: html css

我在- (void)viewDidLoad { ... [self.webView.scrollView addObserver:self forKeyPath:@"contentSize" options:NSKeyValueObservingOptionNew context:nil]; } - (void)dealloc { [self.webView.scrollView removeObserver:self forKeyPath:@"contentSize" context:nil]; } - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { if (object == self.webView.scrollView && [keyPath isEqual:@"contentSize"]) { // we are here because the contentSize of the WebView's scrollview changed. UIScrollView *scrollView = self.webView.scrollView; NSLog(@"New contentSize: %f x %f", scrollView.contentSize.width, scrollView.contentSize.height); } } 标记内嵌入SVG图像:

<object>

我尝试在<object type="image/svg+xml" data="images/quatrefoil.svg" width="100%" height="100%" class="svg-content"></object> 标记中添加<p class="arvo">段,但文字没有显示。我该如何编写以便在SVG对象的顶部查看段落文本?

1 个答案:

答案 0 :(得分:1)

使用共享父

<div class="container">
    <svg ...>
    <p class="description">...</p>
</div>

一起
.container {
    position: relative;
    width: {x}px;
    height: {x}px;
}

.container svg {
    position: relative;
    width: 100%; height: 100%;
    z-index: 1;
}

.container .description {
    position: absolute;
    bottom: 0px;
    width: 100%;
    z-index: 999; /* or something sufficiently large */
}
相关问题