problem with CSS with Primefaces

Asked

Viewed 601 times

2

inserir a descrição da imagem aqui

I’m trying to get the edges of the field Modality, being that I can’t, I’m thinking a pesteira that I’m wrong.

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:p="http://primefaces.org/ui"
    xmlns:f="http://java.sun.com/jsf/core">
<h:head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <h:outputStylesheet library="css" name="style.css"  />
</h:head>
<h:body>

    <h:form id="frm">

        <p:messages autoUpdate="true" />
        <f:facet name="header">
    Cadastro de Contratos Algaworks
    </f:facet>

        <p:panelGrid columns="2">
            <p:outputLabel value="Razao Social" for="razao" />
            <p:inputText id="razao" value="#{cadastroContratoBean.razaoS}"
                required="true" />
            <p:outputLabel value="CNPJ" for="cnpj" />
            <p:inputMask id="cnpj" mask="99.999.999/9999-99" maxlength="20"
                value="#{cadastroContratoBean.cnpj}" />
            <p:outputLabel value="Cidade do Contrato" for="cidade" />
            <p:autoComplete id="cidade"
                value="#{cadastroContratoBean.cidades_do_Contrato}" required="true"
                completeMethod="#{cadastroContratoBean.sugerirCidades}" />

            <p:outputLabel value="Modalidade" for="modalidade" />
            <p:selectOneRadio value="#{cadastroContratoBean.tipo}" id="modalidade" required="true" styleClass="sem-bordas">
                <f:selectItem itemLabel="EAD" itemValue="EAD" />
                <f:selectItem itemLabel="Presencial" itemValue="Presencial" />

            </p:selectOneRadio>

        </p:panelGrid>

        <p:commandButton value="Cadastrar"
            action="#{cadastroContratoBean.Cadastrar}" />

    </h:form>
</h:body>
</html>

CSS

.sem-bordas td{
    border: none;
    padding: 5px;
}

inserir a descrição da imagem aqui

1 answer

2

You can do the following test.:

  1. Add the ! Important ex.: .sem-bordas td{ border: none !important; padding: 5px !important; } To identify if there are any classes that overlap your added style.

  2. I also don’t know if td exists in the html generated by f:selectItem.

Important: The best way to identify these problems is inspected the element by the browser itself.

  • Just to confirm that yes, it generates a table.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.