小编TK *_*nov的帖子

Chrome用户代理样式表会覆盖我的网站样式

我有以下CSS在我的一个页面上为链接设置样式:

a:link, a:visited, a:active {
    color: white;
    text-decoration: none;
    font-weight: bold;
}
Run Code Online (Sandbox Code Playgroud)

但是,当我加载它时,它们在Chrome中显示为蓝色,在Firefox中显示为白色.Chrome开发工具显示我的风格应该覆盖用户代理样式表:

在此输入图像描述

为什么没有正确显示?我尝试在样式表的顶部设置charset:

@charset "UTF-8";

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    font: 11px "Lucida Grande", Arial, Sans-serif;
}

a:link, a:visited, a:active {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

input[type=email], input[type=password] {
    display: block;
    -moz-border-radius: 4px;
    -webkit-border-radius: 4px;
    border: 1px solid #ACE;
    font-size: 13px;
    margin: 0 0 5px;
    padding: 5px;
    width: 203px;
}
Run Code Online (Sandbox Code Playgroud)

但它没有帮助.我的样式表在头部链接:

<link href="/assets/global.css?body=1" media="screen" rel="stylesheet"
type="text/css">
Run Code Online (Sandbox Code Playgroud)

和链接的HTML代码:

<a href="/users/sign_in">Sign in</a>
<a href="/users/password/new">Forgot your …
Run Code Online (Sandbox Code Playgroud)

html css google-chrome ruby-on-rails web

23
推荐指数
3
解决办法
8万
查看次数

无法在Tycho项目中解决Mockito依赖项

可能重复:
如何在tycho中引用mockito?

我正在尝试使用Tycho构建一个测试功能项目,但它无法解决我父pom中列出的Maven中央存储库中我的pom中列出的依赖项.这是我父母pom的相关部分:

    <properties>
            <tycho-version>0.12.0</tycho-version>
    </properties>

    <repositories>
            <repository>
                    <id>helios</id>
                    <layout>p2</layout>
                    <url>http://download.eclipse.org/releases/helios/</url>
            </repository>
    </repositories>

    <pluginRepositories>
            <pluginRepository>
                    <id>central</id>
                    <name>Maven Plugin Repository</name>
                    <url>http://repo1.maven.org/maven2</url>
                    <layout>default</layout>
                    <snapshots>
                            <enabled>false</enabled>
                    </snapshots>
                    <releases>
                            <updatePolicy>never</updatePolicy>
                    </releases>
            </pluginRepository>
    </pluginRepositories>

    <build>
            <plugins>
                    <plugin>
                            <groupId>org.eclipse.tycho</groupId>
                            <artifactId>tycho-maven-plugin</artifactId>
                            <version>${tycho-version}</version>
                            <extensions>true</extensions>
                    </plugin>
                    <plugin>
                            <groupId>org.eclipse.tycho</groupId>
                            <artifactId>target-platform-configuration</artifactId>
                            <version>${tycho-version}</version>

                            <configuration>
                                    <pomDependencies>consider</pomDependencies>

                                    <resolver>p2</resolver>

                                    <environments>
                                            <environment>
                                                    <os>linux</os>
                                                    <ws>gtk</ws>
                                                    <arch>x86_64</arch>
                                            </environment>
                                            <environment>
                                                    <os>win32</os>
                                                    <ws>win32</ws>
                                                    <arch>x86</arch>
                                            </environment>
                                    </environments>
                            </configuration>
                    </plugin>
            </plugins>
    </build>
Run Code Online (Sandbox Code Playgroud)

在这里我的功能pom:

    <modelVersion>4.0.0</modelVersion>
    <parent>
            <artifactId>parent</artifactId>
            <groupId>com.example</groupId>
            <version>1.0.0-SNAPSHOT</version>
    </parent>
    <groupId>com.example</groupId>
    <artifactId>com.example.testing.feature</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>eclipse-feature</packaging>

    <dependencyManagement>
            <dependencies>
                    <dependency>
                            <groupId>org.mockito</groupId>
                            <artifactId>mockito-all</artifactId>
                            <version>1.8.5</version>
                    </dependency>
            </dependencies>
    </dependencyManagement> …
Run Code Online (Sandbox Code Playgroud)

maven-3 tycho

5
推荐指数
1
解决办法
7589
查看次数

Apache POI:替换段落文本

我正在使用Apache POI从模板生成docx文件.似乎没有一种明显的方法来替换段落中的所有文本,文档很少.现在我能够通过循环遍历段落读取文档,然后循环遍历每个段落的运行,然后循环遍历每个运行的文本......这非常有效,我可以在运行中替换文本的内容,但是我的模板占位符(例如:<>)可能会分成几个运行,这使匹配和替换变得非常复杂.有没有办法设置XWPFParagraph的内容?或者至少是一种方法来消除段落中的所有运行并创建自己的运行?

这是我到目前为止:

    public static void main(String[] args) {

    InputStream fs = null;
    try {
        fs = new FileInputStream("C:\\sample1.docx");
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    }
    XWPFDocument doc = null;
    try {
        doc = new XWPFDocument(fs);
    } catch (IOException e) {
        e.printStackTrace();
    }

    for (int i = 0; i < doc.getParagraphs().length; i++) {
        XWPFParagraph paragraph = doc.getParagraphs()[i];
        paragraph.getCTP().getRArray().

        // This will output the paragraph's contents.
        System.out.println(paragraph.getParagraphText());

        for (int j = 0; j < paragraph.getCTP().getRArray().length; j++) {
            CTR run = paragraph.getCTP().getRArray()[j]; …
Run Code Online (Sandbox Code Playgroud)

apache ms-word apache-poi

2
推荐指数
1
解决办法
9794
查看次数

标签 统计

apache ×1

apache-poi ×1

css ×1

google-chrome ×1

html ×1

maven-3 ×1

ms-word ×1

ruby-on-rails ×1

tycho ×1

web ×1