需要有关添加按钮和文本对齐方式的帮助


need help in adding button and text alignment

请帮助我为下载链接添加按钮并将其对齐到页面中心。

提前谢谢。

代码编写如下:

<?php
    // show download link?
    $allow_save = false;
    if ( ! empty( $links[1] ) ) {   // link empty = secure document; ignore any other save attribute
        if ( $save == "all" || $save == "1" ) {
            $allow_save = true;
        } elseif ( $save == "users" && is_user_logged_in() ) {
            $allow_save = true;
        }
    }
    if ( $allow_save ) {
        // build download link
        $linkcode = '<p class="gde-text"><a href="%LINK%" class="gde-link"%ATTRS%>%TXT%</a></p>';
        $linkcode = str_replace( "%LINK%", $links[1], $linkcode );
        // fix type
        $ftype = strtoupper( $fnp[1] );
        if ( $ftype == "TIF" ) { 
            $ftype = "TIFF";
        }
        // link attributes
        if ( $profile['link_mask'] == "yes" ) {
            $attr[] = ' rel="nofollow"';
        }
        $attr[] = gde_ga_event( $file ); // GA integration
        $linkcode = str_replace("%ATTRS%", implode( '', $attr ), $linkcode);
        // link text
        if ( empty( $profile['link_text'] ) ) {
            $profile['link_text'] = __('Download', 'google-document-embedder');
        }

        $dltext = str_replace( "%FILE", $fn, $profile['link_text'] );
        $dltext = str_replace( "%TYPE", $ftype, $dltext );
        $dltext = str_replace( "%SIZE", gde_format_bytes( $status['fsize'] ), $dltext );
        $linkcode = str_replace( "%TXT%", $dltext, $linkcode );
    } else {
        $linkcode = '';
    }
    // link position
    if ( $profile['link_pos'] == "above" ) {
        $code = $linkcode . "'n" . $vwr;
    } else {
        $code = $vwr . "'n" . $linkcode;
    }
  }
}

它可能会帮助你

.gde-text{
  text-align: center;
}
.gde-text a {
  background-color: gold;
  border-radius: 10px;
  color: green;
  font-family: times new roman;
  padding: 10px;
  text-decoration: none;
}
<p class="gde-text"><a href="%LINK%" class="gde-link"%ATTRS%>%TXT%</a></p>